-
Type:
Task
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Block Manager, Documentation, Statistics
-
None
-
Storage Engines - Persistence
-
SE Persistence - 2026-03-27, SE Persistence - 2026-04-10
-
None
Issue Summary
The comment in the codebase for the block_free statistic currently states:
/* Increment the free block statistic when not running salvage. */
However, this comment does not explain the rationale behind excluding salvage operations from incrementing the block_free stat. The salvage operation is a corruption repair process, while compaction and reconciliation/eviction are user-driven activities. The lack of explanation has led to confusion among developers.
Context
- The relevant code snippet is:
/* Increment the free block statistic when not running salvage. */ if (!F_ISSET(S2BT(session), WT_BTREE_SALVAGE)) { WT_STAT_DSRC_INCR(session, block_free); }
- The rationale is that salvage is a corruption repair operation and should not be counted as normal block freeing, which is typically due to user activity (compaction, reconciliation, eviction).
- The current comment does not clarify this distinction.
Proposed Solution
Update the code comment to clearly state why salvage is excluded from incrementing the block_free statistic, specifically noting that salvage is a corruption repair operation and not user-driven.
Original Slack thread: Slack Thread
This ticket was generated by AI from a Slack thread.