Add missing stat to track bytes written when compaction triggers page reconciliation

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Fixed
    • Priority: Minor - P4
    • WT12.0.0, 9.0.0-rc0
    • Affects Version/s: None
    • Component/s: Compaction
    • None
    • Storage Engines - Persistence
    • 236.755
    • SE Persistence backlog
    • None

      Problem

      WT_PAGE_COMPACTION_WRITE is set in bt_compact.c when compaction marks an in-memory page for rewriting, and unconditionally cleared in rec_write.c after __reconcile() returns. No code between those two points checks the flag or emits a stat.

      The existing compaction write byte stat only covers the direct on-disk block relocation path (__wt_block_compact_page_rewrite). The reconciliation path — where compaction dirties an in-memory page and lets it flow through normal reconciliation — is entirely unaccounted for, leaving a gap in compaction I/O observability.

      Fix

      Add a new connection-level stat incremented in rec_write.c when the WT_PAGE_COMPACTION_WRITE flag is set at reconciliation time, before the flag is cleared. This closes the observability gap and makes compaction-driven writes fully visible regardless of which path triggered them.

      References

      • Flag set: bt_compact.c — compaction marks in-memory page for rewriting
      • Flag cleared: rec_write.c — unconditionally after __reconcile() returns
      • Defined: btmem.h

            Assignee:
            Etienne Petrel
            Reporter:
            Etienne Petrel
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: