-
Type: Bug
-
Resolution: Fixed
-
Priority: Minor - P4
-
Affects Version/s: None
-
Component/s: None
-
StorEng - Defined Pipeline
-
v5.0
Summary
Compact incorrectly tabulates the number of pages it has examined and moved.
Compact walks a BTree examining each block address to determine if rewriting that block would help with compaction. Compact maintains three statistics in the WT_BLOCK that track that progress:
- WT_BLOCK.compact_pages_reviewed: The total number of pages examined
- WT_BLOCK.compact_pages_skipped: The total number of pages skipped (i.e., not relocated) because they won't help with compaction.
- WT_BLOCK.compact_pages_rewritten: The total number of pages rewritten as part of compaction.
These metrics are reported as part of WT statistics. If compact_progress verbose messages are enabled they are also displayed periodically during compact.
The problem is that many (most?) checks during the compact walk don't update these statistics.
Specifically, WT-6001 introduced a new block manager method, __wt_block_compact_page_rewrite() that checks if compact should move a block and if so moves it at the block manager layer – saving the work of loading it into the cache and later reconciling it out of the cache. The problem is that this new method doesn't update these compaction statistics.