Add a new collectionValidateOptions option, sizeStats which collects database metrics while validating the cluster

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Fixed
    • Priority: Major - P3
    • 9.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      We want per-collection/index on-disk size analytics (page counts and bytes by page type, key/value bytes and counts, and a leaf page-size histogram) without paying for a separate tree walk. collHash validation already scans every b-tree, so we piggyback on that scan.

      Work:

      • Thread a size-stats flag from ValidationOptions through the RecoveryUnit onto the WiredTiger cursors used by the collHash record-store and index scans, so those cursors open with debug=(size_stats).
      • Size-stats cursors bypass the cursor cache and are closed (not released) so each scan resets and re-accumulates cleanly.
      • After each scan, read the accumulated stats off the b-tree data handle and log one summary line per collection/index (LOGV2 10930500), reporting the on-disk file URI.
      • Added a btree_size_no_image_pages counter to quantify pages skipped for lacking an on-disk image.
      • Behavior: sizeStats:true requires collHash:true; plain collHash validation stays silent and incurs no extra work. Available via the validate command and --validate startup (collectionValidateOptions).

      Testing: Covered by jstests/noPassthrough/validate/collhash_size_metrics.js.

            Assignee:
            Luke Pearson
            Reporter:
            Luke Pearson
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: