-
Type:
Improvement
-
Resolution: Fixed
-
Priority:
Major - P3
-
Affects Version/s: None
-
Component/s: Compaction
-
None
-
Storage Engines - Persistence
-
616.362
-
StorEng - Defined Pipeline
-
None
-
- Problem
`__compact_page_skip()` decides whether relocating a page is worthwhile. It answers that
by walking the by-offset available list under `block->live_lock`, stopping at the first
extent large enough or at the first extent past the limit.
The walk runs once per reviewed page. When the front of the file holds many extents that
are all too small for the request, every reviewed page repeats the same unsuccessful walk
while holding the allocator's lock.
-
- Proposed change
Answer the same question from the by-size buckets instead. `__block_size_srch()` positions
at the first size-sufficient bucket, and each bucket's extents are sorted by offset, so
"some qualifying extent starts before the limit" is equivalent to "some size-sufficient
bucket's head starts before the limit".
Only the existence of a qualifying extent matters here — unlike `__block_first_srch()`,
which has to find the lowest offset — so the search returns at the first such bucket. The
cost becomes a function of the number of distinct extent sizes rather than the number of
extents in front of the limit.
Both forms test only where an extent starts, so an extent beginning before the limit and
reaching past it still counts. That is existing behaviour, preserved deliberately.
-
- Related
- *WT-18826* — independent: this changes a boolean existence check, not which extent