-
Type:
Task
-
Resolution: Fixed
-
Priority:
Major - P3
-
Affects Version/s: None
-
Component/s: Cursors, Statistics
-
None
-
Storage Engines - Persistence
-
1,246.709
-
SE Persistence backlog
-
None
MongoDB's collHash validation scans a collection's record store and indexes but does not run session->verify, so there is currently no free way to collect on-disk size information during that scan.
This feature adds a cursor-open option, debug=(size_stats), that accumulates a per-b-tree size summary into new btree_size_* data-source statistics as the cursor traverses the tree. Accounting hooks the single per-page choke point in the tree walk, so it piggybacks on a scan the caller already performs rather than adding a pass. The results are read back with a statistics cursor.
The summary records raw constituents only: per-page-type counts and uncompressed bytes, leaf key/value bytes and counts, overflow payloads, and a leaf page-size histogram, all derived from the on-disk image. Derived figures (overhead, totals) are left to the consumer.
Scope/constraints:
- Row-store only; returns EINVAL otherwise.
- Kept deliberately separate from tree-walk statistics, which measure logical in-memory state from a dedicated walk.
- Consumer (collHash) owns correct single-pass usage to avoid double-counting.
- is depended on by
-
SERVER-128946 [StorEx] Add logical size metrics to serverStatus
-
- Closed
-
-
SERVER-129519 Add a new collectionValidateOptions option, sizeStats which collects database metrics while validating the cluster
-
- Closed
-
- related to
-
WT-18078 test_size_stats01 AssertionError
-
- Closed
-