m_deferred = true;
BEESLOGINFO("Crawl waiting for transid span: " << available << " available, " << span << " required");
} else {
- // Start new crawl
- crawl_state.m_min_transid = crawl_state.m_max_transid;
+ // Start new crawl.
+ //
+ // The new window begins one past the old one, not at it.
+ // Both ends of the range are inclusive (see the gen_low /
+ // gen_high filters in find_next_extent), so starting at the
+ // old max would scan every extent at that transid a second
+ // time -- once as the previous window's upper bound and
+ // again as this window's lower bound.
+ //
+ // This is only safe because effective_transid_max() is held
+ // strictly below the current transid by the temp extent
+ // floor. Every transid a window covers is therefore already
+ // committed, and a committed transaction's extent set cannot
+ // grow, so no extent can appear at the old max after the
+ // sweep's cursor has passed it. The open transid is the only
+ // one whose membership in the scan set is still in doubt, and
+ // it is never scanned. If that floor is ever removed, this
+ // must go back to overlapping by one.
+ crawl_state.m_min_transid = crawl_state.m_max_transid + 1;
crawl_state.m_max_transid = target_max;
crawl_state.m_objectid = 0;
crawl_state.m_offset = 0;