Report the version-window reset's releases and erasures in the metrics #101

Open
weaselbot wants to merge 1 commits from weaselbot/conflict-set:weaselbot/issue-100 into main
pull from: weaselbot/conflict-set:weaselbot/issue-100
1 Commits
Author SHA1 Message Date
weaselbot b1c1c39611 Report the version-window reset's releases and erasures in the metrics
CI / pre-commit (pull_request) Successful in 2m18s
CI / test (arm64, -DCMAKE_BUILD_TYPE=Debug -DMSAN_TOOLCHAIN_PATH=/opt/msan, 22, https://minio.weaselab.dev/public/aarch64/msan-toolchain-22.1.8.tar.zst, debug-arm64, ubuntu-latest-arm64) (pull_request) Successful in 3m56s
CI / test (amd64, -DCMAKE_BUILD_TYPE=Debug -DMSAN_TOOLCHAIN_PATH=/opt/msan, 21, https://minio.weaselab.dev/public/x86_64/msan-toolchain-21.1.8.tar.zst, debug, ubuntu-latest-amd64) (pull_request) Successful in 4m2s
CI / release (arm64, , ubuntu-latest-arm64) (pull_request) Successful in 3m32s
CI / test (amd64, -DCMAKE_CXX_FLAGS=-DUSE_64_BIT=1, 21, , 64-bit-versions, ubuntu-latest-amd64) (pull_request) Successful in 3m37s
CI / test (amd64, -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++, 21, , gcc, ubuntu-latest-amd64) (pull_request) Successful in 3m35s
CI / test (amd64, -DUSE_SIMD_FALLBACK=ON, 21, , simd-fallback, ubuntu-latest-amd64) (pull_request) Successful in 3m41s
CI / release (amd64, -DMSAN_TOOLCHAIN_PATH=/opt/msan, ubuntu-latest-amd64) (pull_request) Successful in 6m2s
CI / coverage (pull_request) Successful in 4m9s
`addWrites()` tears down the whole tree with `eraseTree()` when the version
window is exceeded, then calls `init()`, which reconstructs the `WriteContext`
and zeroes `accum`. Everything `eraseTree()` accounted for was discarded
before the metrics were reported, so `nodes_released_total` and
`entries_erased_total` never reflected the one path that frees an entire tree.

`init()` now carries `accum` across the reconstruction of `writeContext`, so
the accounting done before the reset still gets reported by `addWrites()`.

`eraseTree()` also incremented `accum.nodes_released` itself before calling
`release()`, which increments the same counter, double counting every node it
released. That was only invisible because `init()` zeroed `accum`. Drop the
redundant increment and keep the entry accounting, which `release()` does not
do.

Extend ShowMemoryTest.cpp to check that a version jump reports the nodes and
entries it erases.

Closes #100
2026-11-10 15:06:19 -05:00