Skip to content

valuelog: bound sealed mmap growth and export residency stats#827

Open
snissn wants to merge 20 commits intopr/rss-pressure-pool-governorfrom
pr/batch-arena-tail-compaction
Open

valuelog: bound sealed mmap growth and export residency stats#827
snissn wants to merge 20 commits intopr/rss-pressure-pool-governorfrom
pr/batch-arena-tail-compaction

Conversation

@snissn
Copy link
Copy Markdown
Owner

@snissn snissn commented Mar 14, 2026

Summary

  • lazily mmap value-log segments on open instead of eagerly mapping every registered file
  • mark only the current writable segment per lane as persistently remappable
  • bound sealed-segment lazy mmap growth and fall back to ReadAt for cold sealed reads once the sealed-map budget is full
  • export value-log mmap residency stats for active and dead mapped bytes
  • add focused tests for lazy-open, current-writable promotion, residency aggregation, and sealed-budget fallback behavior

Why

  • recent Celestia profiling showed TreeDB losing to goleveldb primarily on file-backed RSS, not anonymous heap
  • the dominant suspected mechanism was cumulative value-log mmap residency across sealed segments
  • this change makes mapped-file growth explicit and bounded instead of letting it scale with total sealed segment footprint

Validation

  • go test ./TreeDB/internal/valuelog -run 'PromoteCurrentWritable|SealedLazyMmapBudget|OpenFile_DoesNotEagerlyMap|Mmap'
  • go test ./TreeDB/db ./TreeDB/caching
  • go vet ./TreeDB/internal/valuelog ./TreeDB/db ./TreeDB/caching

Celestia Evidence

Using /home/mikers/run_celestia.sh with LOCAL_GOMAP_DIR=/home/mikers/dev/snissn/gomap-gemini on March 14, 2026:

fast

  • run home: /home/mikers/.celestia-app-mainnet-treedb-20260314220733
  • duration_seconds=351
  • max_rss_kb=12720776
  • end_app_bytes=5936149499
  • near-peak smaps_rollup: Pss_File=761415 kB, Anonymous=11664956 kB

wal_on_fast

  • run home: /home/mikers/.celestia-app-mainnet-treedb-20260314221413
  • duration_seconds=446
  • max_rss_kb=13300632
  • end_app_bytes=5940826699
  • near-peak smaps_rollup: Pss_File=547278 kB, Anonymous=12101152 kB

Interpretation

  • this materially reduces file-backed RSS versus the earlier multi-GB Pss_File captures
  • after this change, peak TreeDB RSS is now dominated primarily by anonymous memory, which shifts the next optimization pass toward batch/value/read-path heap pressure rather than mmap residency

Copilot AI review requested due to automatic review settings March 14, 2026 05:03
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR reduces retained heap/RSS pressure in TreeDB’s cached write path by compacting pathologically underfilled batch copy-arena tail chunks before those chunks are leased to memtables, and adds instrumentation + tests to validate behavior.

Changes:

  • Add batch arena tail-compaction logic that clones only entry slices aliasing an underfilled tail chunk, then releases the tail chunk before lease retention.
  • Add new TreeDB stats counters for tail compaction (runs, copied bytes, saved bytes).
  • Surface the new counters in unified-bench cache stat output and add focused unit tests.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
TreeDB/caching/db.go Implements tail-compaction logic, adds DB counters, and exposes new stats keys.
TreeDB/caching/batch_arena_budget_test.go Adds unit tests for alias-preserving cloning and no-op behavior for near-full tails.
cmd/unified_bench/main.go Prints the new tail-compaction stats in the compact cache stats output.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Copilot AI review requested due to automatic review settings March 14, 2026 09:22
@snissn
Copy link
Copy Markdown
Owner Author

snissn commented Mar 14, 2026

Validation update for commit aaacae8 (pressure-aware retention/clamp hardening).\n\nLocal checks:\n- GOWORK=off go test ./TreeDB/... ✅\n- GOWORK=off go vet ./TreeDB/... ✅\n- Unified bench profile dir: /home/mikers/tmp/perf-1773478400\n\nSame-window run_celestia A/B (serial), patched vs prepatch control (37b0483):\n\nfast\n- patched home: /home/mikers/.celestia-app-mainnet-treedb-20260313225408\n- prepatch home: /home/mikers/.celestia-app-mainnet-treedb-20260313231047\n- duration_seconds: 260 vs 292 (patched -32s)\n- max_rss_kb: 26305104 vs 28065736 (patched -1760632 kB)\n- end_app_bytes: 5734421000 vs 5625820250 (patched +108600750 B)\n\nwal_on_fast\n- patched home: /home/mikers/.celestia-app-mainnet-treedb-20260313225850\n- prepatch home: /home/mikers/.celestia-app-mainnet-treedb-20260313231603\n- duration_seconds: 338 vs 349 (patched -11s)\n- max_rss_kb: 26477336 vs 26364472 (patched +112864 kB)\n- end_app_bytes: 4999204828 vs 5441349237 (patched -442144409 B)\n\nHeap-capture artifacts are present under each run's sync/diagnostics directory (pprof-heap-max-rss-*).\n\nInterpretation: this step is a net improvement on wall time in both profiles, improves RSS materially in fast and is near-neutral in wal_on_fast, with mixed end_app_bytes impact across profiles.\n

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR reduces heap/RSS pressure in the caching DB by compacting pathologically underfilled batch copy-arena tail chunks before those chunks are leased/retained by memtables, while adding new memory-pressure-aware retention/sizing behavior and surfacing new stats + tests.

Changes:

  • Add batch arena tail compaction that clones only entry slices aliasing the underfilled tail, then drops the tail chunk before lease handoff; track new tail-compaction counters in DB stats.
  • Make several pools/arenas pressure-aware (batch copy arena max chunk sizing, append-only direct arena retention limits, and skipping batch aux pool retention under pressure).
  • Add targeted tests for tail compaction correctness (slice aliasing + pointer metadata stability), pressure-aware sizing/retention, and vlog maintenance cancellation still running forced GC.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
cmd/unified_bench/main.go Prints newly added batch-arena tail compaction stats in unified-bench cache stat output.
TreeDB/caching/db.go Implements tail compaction + new stats; adds pressure-aware chunk sizing, append-only retention limits, and pressure-based dropping of batch aux pool entries; tweaks vlog generation maintenance cancellation behavior.
TreeDB/caching/vlog_generation_scheduler_test.go Adds coverage ensuring forced GC still runs when rewrite planning is canceled by resumed foreground activity.
TreeDB/caching/pool_pressure_test.go Adds test asserting batch aux pools skip retention under critical heap pressure and increment new counters.
TreeDB/caching/batch_arena_sizing_test.go Adds tests verifying batch copy-arena init/growth clamps under critical pressure while still allowing large single writes.
TreeDB/caching/batch_arena_budget_test.go Updates budget cap expectation and adds focused tail-compaction tests (alias-preserving clone + tail drop, and near-full no-op).
TreeDB/caching/append_only_direct_writer_pool_test.go Adds test for append-only direct arena pressure-aware retention limits.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@snissn
Copy link
Copy Markdown
Owner Author

snissn commented Mar 14, 2026

Validation update for commit 8ebeeb1 (batch-arena retained hard cap + borrow gating).

What changed:

  • hard cap for retained batch arena bytes (pool + global leases)
  • pool drop path now enforces hard cap
  • cached batch write path disables Steal/borrow when cap is reached, falling back to copy ownership
  • new stats/counters:
    • retained_hard_cap_bytes
    • leased_bytes_global_estimate
    • pool_drop_hard_cap_bytes_total
    • borrow_blocked_total
  • tests added for hard-cap/drop behavior and sustained-write lease bounding

Local checks:

  • GOWORK=off go test ./TreeDB/caching ✅
  • (earlier in cycle) GOWORK=off go test ./TreeDB/... ✅
  • (earlier in cycle) GOWORK=off go vet ./TreeDB/... ✅

Unified bench (same command as thread):

  • profile dir: /home/mikers/tmp/perf-hardcap-1773483160
  • mixed synthetic signal:
    • sequential_write alloc_space getAppendOnlyEntriesFromPool: 66.77MB (unchanged)
    • sequential_write alloc_space getAppendOnlyDirectValueArenaChunk: 38.68MB (up from 34.56MB)
    • batch paths remain dominated by getBatchArena alloc-space attribution

Decisive A/B: serial run_celestia same-window control (new code vs aaacae8)

Candidate (8ebeeb1):

  • fast: /home/mikers/.celestia-app-mainnet-treedb-20260314002500
    • duration_seconds=250
    • max_rss_kb=17791800
    • end_app_bytes=4846848570
  • wal_on_fast: /home/mikers/.celestia-app-mainnet-treedb-20260314002926
    • duration_seconds=284
    • max_rss_kb=17703356
    • end_app_bytes=4496555355

Control (aaacae8):

  • fast: /home/mikers/.celestia-app-mainnet-treedb-20260314003515
    • duration_seconds=259
    • max_rss_kb=20065456
    • end_app_bytes=4799913092
  • wal_on_fast: /home/mikers/.celestia-app-mainnet-treedb-20260314003948
    • duration_seconds=283
    • max_rss_kb=20648844
    • end_app_bytes=4940038875

Deltas (candidate - control):

  • fast:
    • duration: -9s
    • max_rss: -2,273,656 kB
    • end_app_bytes: +46,935,478 B
  • wal_on_fast:
    • duration: +1s (near neutral)
    • max_rss: -2,945,488 kB
    • end_app_bytes: -443,483,520 B

Interpretation:

  • strong RSS reduction in both profiles (~2.2-2.9GB)
  • wall-time neutral-to-better
  • end_app mixed on fast, strong win on wal_on_fast

Copilot AI review requested due to automatic review settings March 14, 2026 17:22
@snissn
Copy link
Copy Markdown
Owner Author

snissn commented Mar 14, 2026

Follow-up validation for commit 4b465cb (preflight borrow admission).

What changed:

  • New preflight admission in cached batch path:
    • if current_retained + prospective_batch_chunk_caps > retained_hard_cap, disable borrow/steal for that write
  • Added counters:
    • batch_arena.borrow_preflight_blocked_total
    • batch_arena.borrow_preflight_blocked_bytes_total
  • Added tests for preflight gate and large-first-batch no-lease behavior.

Checks:

  • GOWORK=off go test ./TreeDB/caching
  • (already green in branch before this commit) go test ./TreeDB/..., go vet ./TreeDB/...

Same-window serial run_celestia A/B (candidate 4b465cb vs control aaacae8):

Candidate:

  • fast: /home/mikers/.celestia-app-mainnet-treedb-20260314065930
    • duration_seconds=251
    • max_rss_kb=17068964
    • end_app_bytes=4884822092
  • wal_on_fast: /home/mikers/.celestia-app-mainnet-treedb-20260314070402
    • duration_seconds=351
    • max_rss_kb=24929264
    • end_app_bytes=5895015311

Control (aaacae8):

  • fast: /home/mikers/.celestia-app-mainnet-treedb-20260314071706
    • duration_seconds=295
    • max_rss_kb=29454328
    • end_app_bytes=6276113577
  • wal_on_fast: /home/mikers/.celestia-app-mainnet-treedb-20260314071035
    • duration_seconds=361
    • max_rss_kb=27366176
    • end_app_bytes=5845124780

Deltas (candidate - control):

  • fast: -44s, -12,385,364 kB RSS, -1,391,291,485 B end_app
  • wal_on_fast: -10s, -2,436,912 kB RSS, +49,890,531 B end_app

Interpretation:

  • strong runtime RSS win in both profiles
  • wall time improves in both profiles
  • disk improves materially on fast; slight end_app increase on wal_on_fast

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR reduces memory retention pressure in TreeDB’s caching layer by compacting pathologically underfilled batch arena tail chunks before handing ownership/leases to memtables, while adding pressure-aware retention limits and new observability counters.

Changes:

  • Add batch-arena tail compaction plus global retained-hard-cap / borrow gating and pressure-aware chunk sizing/aux-pool retention controls.
  • Surface new batch-arena tail-compaction counters in TreeDB stats and unified-bench cache stat output.
  • Add targeted tests covering tail compaction semantics, hard-cap gating, pool-pressure behavior, and generational vlog maintenance cancellation behavior.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
cmd/unified_bench/main.go Prints new batch-arena tail-compaction counters in cache stats output.
TreeDB/caching/db.go Implements tail compaction, global retained hard-cap estimation + borrow gating, pressure-aware sizing/retention, and new stats counters; adjusts vlog maintenance cancellation handling to still run GC.
TreeDB/caching/vlog_generation_scheduler_test.go Adds a regression test ensuring forced GC still runs after rewrite-plan cancellation.
TreeDB/caching/pool_pressure_test.go Adds coverage that batch auxiliary pools skip retention under critical pressure.
TreeDB/caching/batch_arena_sizing_test.go Tests critical-pressure clamping and “large write still allowed” behavior for batch arena chunk sizing.
TreeDB/caching/batch_arena_ownership_test.go Adds tests for retained-hard-cap behavior across sustained writes and preflight blocking.
TreeDB/caching/batch_arena_budget_test.go Updates pool-budget saturation expectation; adds tests for hard-cap override, preflight borrow blocking, hard-cap pool drop, and tail compaction mechanics.
TreeDB/caching/append_only_direct_writer_pool_test.go Adds pressure-aware retention limit test for append-only direct value arena retention.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4b465cbf0c

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Copilot AI review requested due to automatic review settings March 14, 2026 22:27
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR primarily targets reducing retained heap/RSS from batch copy-arena tail chunks by compacting pathologically underfilled tails before memtable lease handoff, and adds related instrumentation surfaced via unified-bench. It also expands memory-pressure handling (pool retention/drop behavior, hard caps) and adds debugging/behavioral tweaks around memtable rotation and generational maintenance.

Changes:

  • Add batch arena tail compaction (clone only slices aliasing the underfilled tail, then drop the oversized tail chunk) plus new stats counters and unified-bench output.
  • Introduce pressure-aware retention/sizing policies (batch arena retained hard cap, pressure-clamped copy chunk sizing, append-only direct arena retention limits, dropping aux pool entries under pressure).
  • Add tests and additional operational/debug behavior (iterator-triggered rotation flush triggering, debug memtable rotation logging, adaptive memtable decision telemetry, and ensuring forced GC still runs after rewrite-plan cancellation).

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
cmd/unified_bench/main.go Surface new batch-arena tail-compaction counters in unified-bench cache stats output.
TreeDB/caching/db.go Implement tail compaction + pressure-aware batch arena retention/hard-cap gating; add new stats and tweak rotation/maintenance behaviors.
TreeDB/caching/debug_memtable_rotate.go Add env-gated debug logging for memtable rotation events.
TreeDB/caching/debug_memtable_rotate_test.go Validate mode-label mapping and nil handling for debug rotation logging.
TreeDB/caching/iterator_rotation_flush_test.go Add coverage for iterator-triggered rotations requesting background flush when queue already has work.
TreeDB/caching/vlog_generation_scheduler_test.go Ensure rewrite-plan cancellation still proceeds to forced GC and scheduler returns to idle.
TreeDB/caching/stats_test.go Add test for adaptive BTree min-iterator-samples override behavior.
TreeDB/caching/pool_pressure_test.go Add test ensuring aux batch pools skip retention under critical pressure.
TreeDB/caching/batch_arena_sizing_test.go Add tests for pressure-clamped arena sizing and allowing large single writes.
TreeDB/caching/batch_arena_ownership_test.go Add tests for hard-cap behavior bounding leases and for preflight blocking.
TreeDB/caching/batch_arena_budget_test.go Add tests for hard-cap override, preflight logic, hard-cap drops in pool, and tail compaction.
TreeDB/caching/append_only_direct_writer_pool_test.go Add tests for pressure-aware append-only direct arena retention limits.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@snissn
Copy link
Copy Markdown
Owner Author

snissn commented Mar 14, 2026

Follow-up pushed: c350fb3e.

What changed in this step:

  • Added opt-in memtable rotation diagnostics:
    • TREEDB_DEBUG_MEMTABLE_ROTATE=1
    • TREEDB_DEBUG_MEMTABLE_ROTATE_BUDGET=<n>
    • Emits structured event=start|shard|done for rotateMutableShardsLocked and rotateMemtableLockedWithCapacity.
  • Added iterator-rotation queue guard:
    • rotateMemtableLockedForIterator now sets triggerFlush=true when queue is already non-empty.
    • Goal: prevent repeated tiny iterator-triggered rotations from growing immutable queue depth without backpressure.
  • Added tests:
    • TestDebugMemtableModeLabel_*
    • TestIteratorRotation_TriggersBackgroundFlushWhenQueueAlreadyHasWork

Validation:

  • go test ./TreeDB/caching -count=1
  • go test ./TreeDB/... -count=1
  • go vet ./TreeDB/...

Celestia runs:

  • fast (post-change, non-debug): /home/mikers/.celestia-app-mainnet-treedb-20260314121459
    • duration_seconds=294
    • max_rss_kb=23631944
    • end_app_bytes=5953646048
  • fast (post-change, debug memtable rotate): /home/mikers/.celestia-app-mainnet-treedb-20260314122032
    • duration_seconds=294
    • max_rss_kb=22051244
    • end_app_bytes=5792547101
  • wal_on_fast sanity (post-change): /home/mikers/.celestia-app-mainnet-treedb-20260314122708
    • duration_seconds=405
    • max_rss_kb=24737144
    • end_app_bytes=5688058774

Key diagnostic delta from debug runs:

  • pre-fix debug fast (...115851):
    • application_hash_sorted_starts=23
    • max_queue_len=352
    • flush_true=0, flush_false=23
  • post-fix debug fast (...122032):
    • application_hash_sorted_starts=24
    • max_queue_len=160
    • flush_true=21, flush_false=3

So this step is acting in the intended direction for the specific tiny-rotation queue-churn pathology.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c350fb3ec3

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@snissn
Copy link
Copy Markdown
Owner Author

snissn commented Mar 14, 2026

Pushed follow-up 0b2118ac.

Change:

  • Memtable rotation now enqueues only non-empty shards (mem.Size()>0 || Len()>0) and retires empty shard memtables immediately via pendingRetiredMems.
  • Applied in both:
    • rotateMutableShardsLocked
    • rotateMemtableLockedWithCapacity
  • Updated/added tests:
    • TestIteratorRotation_EnqueuesOnlyNonEmptyShards
    • TestRotateWithCapacity_EnqueuesOnlyNonEmptyShards
    • TestFlushSkipsEmptyUnitsAndRemovesNonEmptyUnits (updated from old empty-unit expectation)

Validation:

  • go test ./TreeDB/caching -count=1
  • go test ./TreeDB/... -count=1
  • go vet ./TreeDB/...

Same-window branch-vs-main A/B (using LOCAL_GOMAP_DIR=/tmp/gomap-main-baseline for main):

Fast profile:

  • Branch run: /home/mikers/.celestia-app-mainnet-treedb-20260314125323
    • duration 240s, max RSS 15,143,280 KB, end app 4,358,535,744
  • Main run: /home/mikers/.celestia-app-mainnet-treedb-20260314125931
    • duration 248s, max RSS 19,324,864 KB, end app 4,784,130,880
  • Delta (branch-main):
    • wall -8s
    • RSS -4,181,584 KB (~-3.99 GiB)
    • end app -425,595,136 bytes

wal_on_fast profile:

  • Branch run: /home/mikers/.celestia-app-mainnet-treedb-20260314130427
    • duration 272s, max RSS 17,126,928 KB, end app 4,752,676,633
  • Main run: /home/mikers/.celestia-app-mainnet-treedb-20260314130924
    • duration 261s, max RSS 18,230,576 KB, end app 4,752,950,881
  • Delta (branch-main):
    • wall +11s
    • RSS -1,103,648 KB (~-1.05 GiB)
    • end app roughly neutral/slightly better on branch

Interpretation: this step clearly improves RSS and queue-churn behavior; fast wall is improved in this window, wal_on_fast wall is slightly slower in this single pair and needs another sample before treating as a real regression.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0b2118aca9

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@snissn
Copy link
Copy Markdown
Owner Author

snissn commented Mar 15, 2026

Follow-up on iterator-rotation flush aggressiveness experiments.

  1. Requested additional controlled A/B (no code change from 0b2118ac):
  • Branch run: /home/mikers/.celestia-app-mainnet-treedb-20260314140404
    • duration 332s, max RSS 22,443,116 KB, end app 5,131,272,970
  • Main run: /home/mikers/.celestia-app-mainnet-treedb-20260314141304
    • duration 340s, max RSS 24,290,144 KB, end app 5,248,541,280
  • Delta (branch-main): wall -8s, RSS -1,847,028 KB, end app -117,268,310
  1. Aggressive tuning trial (always flush kick on iterator rotation):
  • This variant was tested and then rejected.
  • In its pair, it showed worse wall/RSS behavior and I reverted it completely.
  • Current branch code remains unchanged from the guarded policy (trigger when queue already non-empty).

So current conclusion stands: keep guarded iterator-flush policy; do not merge the always-kick variant.

Copilot AI review requested due to automatic review settings March 15, 2026 05:54
@snissn
Copy link
Copy Markdown
Owner Author

snissn commented Mar 15, 2026

Iteration update: commit 57cdbf3b (outer-leaf build-page pooling on non-maintenance apply) is pushed.

What changed

  • zipper: added a page-sized pool for outer-leaf build buffers and wired it into:
    • root outer-leaf rewrite path in writeRecursive
    • split outer-leaf path in mergeLeaf
  • kept maintenance path behavior conservative (no pooling there) to avoid leaf-ref cache lifetime coupling.

Validation

  • GOWORK=off go test ./TreeDB/... -count=1
  • GOWORK=off go vet ./TreeDB/...

Unified-bench (baseline /tmp/optimize-reads-1773549401 vs new /home/mikers/tmp/perf-1773553234)

  • Throughput deltas (TreeDB):
    • batch_write_steady +3.66%
    • batch_write +3.43%
    • random_read_parallel +2.24%
    • random_write +2.04%
    • random_read +1.79%
    • sequential_write -1.63%
  • Alloc-space signal:
    • allocs_sequential_write_treedb: total ~214.17MB -> 194.28MB (-9.3%)
    • zipper.mergeLeaf drops out of top allocs in this workload (was ~13.05MB flat in prior baseline)

run_celestia serial (with FREEZE_REMOTE_HEIGHT_AT_START=1 for bounded completion)

  • fast: /home/mikers/.celestia-app-mainnet-treedb-20260314194148
    • duration=272s
    • max_rss_kb=19,935,676
    • end_app_bytes=5,537,259,393
    • disk-breakdown du -sb application.db=5,151,970,801
  • wal_on_fast: /home/mikers/.celestia-app-mainnet-treedb-20260314194636
    • duration=371s
    • max_rss_kb=23,144,880
    • end_app_bytes=6,194,712,107
    • disk-breakdown du -sb application.db=6,194,712,107

Note on runtime comparability

  • These freeze-mode runs were at later chain heights than the previous freeze pair, so wall/RSS/app-bytes are not apples-to-apples.
  • Synthetic bench + alloc profiles show the intended allocator win; runtime effect in wal-mode needs a tighter A/B at fixed target height/window.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR reduces memory/RSS pressure from cached batch copy-arena chunks by compacting pathologically underfilled tail chunks before batch-arena leasing/retention, and adds related telemetry and tests across caching/memtable/zipper.

Changes:

  • Add batch arena tail-compaction (clone only entry slices that alias an underfilled tail, then release the oversized tail chunk) plus new stats surfaced in unified-bench output.
  • Introduce/extend memory-retention controls and telemetry (batch-arena retained hard cap, pool-pressure-aware limits, deferred bytes tracking) with additional targeted tests.
  • Update zipper merge paths to reuse apply-lifetime scratch for split keys and optionally reuse outer-leaf build pages.

Reviewed changes

Copilot reviewed 20 out of 20 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
cmd/unified_bench/main.go Surface new batch-arena tail-compaction counters in unified-bench cache stat output.
TreeDB/zipper/zipper.go Add apply scratch reuse for split-key cloning; add outer-leaf build page pooling; thread scratch through merge recursion.
TreeDB/zipper/zipper_test.go Update mergeLeaf callsites; add tests for apply-scratch reuse/reset and arena trimming.
TreeDB/internal/memtable/append_only.go Add hard-reset policy support (drop retained chunks/maps when requested).
TreeDB/internal/memtable/append_only_reset_hard_test.go New test ensuring hard reset clamps post-spike capacity and drops retained arena chunks.
TreeDB/caching/db.go Core changes: tail compaction, batch-arena hard-cap gating, pressure-aware pool retention, deferred-bytes telemetry, retained-arena trimming, iterator rotation flush trigger, adaptive memtable decision telemetry/env knob, and related stats wiring.
TreeDB/caching/vlog_generation_scheduler_test.go Add test ensuring rewrite-plan cancellation still proceeds to forced GC path.
TreeDB/caching/stats_test.go Add test for adaptive memtable BTree min-iterator-samples override behavior + reason tracking.
TreeDB/caching/retained_arena_trim_test.go New test for post-checkpoint retained-arena trimming behavior.
TreeDB/caching/pool_pressure_test.go Add test covering dropping batch aux pools under critical pressure.
TreeDB/caching/memtable_view_telemetry_test.go Extend tests to cover deferred-bytes tracking in view telemetry.
TreeDB/caching/iterator_rotation_flush_test.go New tests ensuring iterator-triggered rotations don’t let queue depth grow unbounded and only enqueue non-empty shards.
TreeDB/caching/iterator_lease_test.go Extend iterator lease tests to assert deferred-bytes stats behavior.
TreeDB/caching/debug_memtable_rotate.go Add optional env-gated debug logging for memtable rotation events.
TreeDB/caching/debug_memtable_rotate_test.go New tests for debug memtable mode labeling (incl. nil).
TreeDB/caching/batch_arena_sizing_test.go Add tests for pressure-aware batch arena chunk sizing/clamping behavior.
TreeDB/caching/batch_arena_ownership_test.go Add tests for retained hard-cap behavior and preflight blocking.
TreeDB/caching/batch_arena_budget_test.go Add tests for new pool-drain and hard-cap/lease/global-bytes helpers and tail-compaction behavior.
TreeDB/caching/backpressure_component_test.go Update test expectations around skipping empty rotate units and flushing non-empty units.
TreeDB/caching/append_only_direct_writer_pool_test.go Add tests for oversize chunk drop, trimRetained caps, and pressure-aware retention limits.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@snissn
Copy link
Copy Markdown
Owner Author

snissn commented Mar 15, 2026

Follow-up push: 157283e3 (outer-leaf build page retention in apply scratch).

What changed

  • zipper: move outer-leaf build page reuse from pure sync.Pool to apply-scratch retained cache (bounded keep cap), with fallback to global pool.
  • Pool entries switched to pointer-backed objects to avoid slice-interface boxing churn.
  • Added tests for apply-scratch outer-leaf page reuse and oversize-cache trimming.

Validation

  • GOWORK=off go test ./TreeDB/... -count=1
  • GOWORK=off go vet ./TreeDB/...
  • Unified bench (full args, no reduced test set):
    • New: /home/mikers/tmp/perf-1773555602
    • Same-time pre-change control (57cdbf3b): /home/mikers/tmp/perf-base-57c-1773555708

run_celestia fixed-height A/B (serial)

  • Note: bootstrap raw.githubusercontent.com fetches were timing out in this environment; I forced fast fallback-to-local-cache during startup so sync comparison itself is unaffected.
  • Patched head (157283e3):
    • fast home: /home/mikers/.celestia-app-mainnet-treedb-20260314203752
    • wal_on_fast home: /home/mikers/.celestia-app-mainnet-treedb-20260314204223
  • Pre-change control (57cdbf3b, LOCAL_GOMAP_DIR=/tmp/gomap-57c):
    • fast home: /home/mikers/.celestia-app-mainnet-treedb-20260314204834
    • wal_on_fast home: /home/mikers/.celestia-app-mainnet-treedb-20260314205316

Key deltas (patched vs pre-change control)

  • fast:
    • duration: 250s vs 262s (-4.6%)
    • max_rss_kb: 14,780,236 vs 17,033,324 (-13.2%)
    • end_app_bytes: 4,543,630,644 vs 4,555,637,226 (-0.26%)
  • wal_on_fast:
    • duration: 273s vs 300s (-9.0%)
    • max_rss_kb: 15,766,128 vs 20,291,532 (-22.3%)
    • end_app_bytes: 4,477,676,271 vs 4,731,877,485 (-5.4%)

Copilot AI review requested due to automatic review settings March 15, 2026 07:37
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR reduces memory/RSS pressure in TreeDB’s caching path by compacting pathologically underfilled batch arena tail chunks before memtable lease/borrow retention, and expands observability + pressure-aware retention/trim behaviors across several cache components.

Changes:

  • Add batch arena tail-compaction (clone only aliased entry slices, drop oversized tail chunk) plus new cache stats surfaced in unified-bench.
  • Introduce pressure-aware retention limits/hard caps and post-flush/checkpoint trimming for batch arenas, entry-slice leases/pools, and append-only direct arenas/memtable leases.
  • Expand observability: deferred-bytes telemetry for memtable views, value-log mmap residency (active/dead bytes), adaptive memtable decision stats + env knob, and debug logging/tests for memtable rotation.

Reviewed changes

Copilot reviewed 24 out of 24 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
cmd/unified_bench/main.go Adds printing of new batch-arena tail-compaction counters in cache stat output.
TreeDB/zipper/zipper.go Introduces apply-lifetime scratch reuse for split-key cloning and outer-leaf build-page buffers.
TreeDB/zipper/zipper_test.go Adds focused tests for apply scratch reuse/trimming and outer-leaf build-page reuse behavior.
TreeDB/internal/valuelog/reader_mmap.go Tracks dead-mapped bytes when remapping grows the mmap.
TreeDB/internal/valuelog/manager.go Adds deadMappedBytes counter + MmapResidencyStats; avoids eager mmap/remap on open.
TreeDB/internal/valuelog/manager_test.go Adds tests for mmap residency aggregation and non-eager mapping on open.
TreeDB/internal/memtable/append_only.go Adds hard reset policy to drop retained buffers after spikes; plumbing for hard reset behavior.
TreeDB/internal/memtable/append_only_reset_hard_test.go Tests that hard reset drops observed spike capacity and retained value-arena chunks.
TreeDB/db/api.go Exposes value-log mmap residency stats via DB Stats() in backend/read-only path.
TreeDB/caching/db.go Implements tail compaction + new retention hard caps, pressure-aware pool behavior, deferred-bytes telemetry, post-flush trims, adaptive memtable decision stats, iterator-rotation flush trigger, and debug rotate logging.
TreeDB/caching/batch_arena_sizing_test.go Tests copy-arena chunk sizing clamps under critical pressure and large-write override behavior.
TreeDB/caching/batch_arena_budget_test.go Adds tests for pool draining, hard-cap behavior, tail-compaction behavior, and hard-cap preflight gating.
TreeDB/caching/batch_arena_ownership_test.go Adds hard-cap lease-growth tests across sustained writes and large-first-batch preflight blocking.
TreeDB/caching/pool_pressure_test.go Tests that auxiliary batch pools skip retention under critical pressure.
TreeDB/caching/append_only_direct_writer_pool_test.go Adds tests for oversize-chunk drop, trimming behavior, and pressure-aware retention limits.
TreeDB/caching/retained_arena_trim_test.go Tests checkpoint-path trimming for append-only caches and retained direct arenas.
TreeDB/caching/vlog_generation_scheduler_test.go Ensures forced GC still runs even when rewrite planning cancels due to resumed foreground reads.
TreeDB/caching/memtable_view_telemetry_test.go Updates tests for deferred-bytes tracking in memtable view telemetry.
TreeDB/caching/iterator_lease_test.go Extends iterator lease tests to validate deferred-bytes stats.
TreeDB/caching/iterator_rotation_flush_test.go Adds tests ensuring iterator-triggered rotation can kick background flush and only enqueues non-empty shards.
TreeDB/caching/debug_memtable_rotate.go Adds env-gated debug logging for memtable rotation events.
TreeDB/caching/debug_memtable_rotate_test.go Tests debugMemtableModeLabel mapping for known memtable implementations.
TreeDB/caching/stats_test.go Adds coverage for adaptive BTree min-iterator-sample override behavior.
TreeDB/caching/backpressure_component_test.go Renames/extends test to validate queue behavior across empty vs non-empty rotates.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b7f3bac819

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@snissn snissn changed the title caching: compact underfilled batch arena tails before lease retention valuelog: bound sealed mmap growth and export residency stats Mar 15, 2026
@snissn snissn requested a review from Copilot March 17, 2026 18:25
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR reduces file-backed RSS and improves memory observability/controls by changing value-log mmap behavior (lazy mapping + bounded sealed-segment residency), adding new mmap residency stats, and tightening several in-memory retention/rotation behaviors in caching/memtable layers.

Changes:

  • Value-log: switch to lazy mmap on open, mark only current-writable segments as persistently remappable, cap sealed-segment mmap residency, and export mmap residency counters.
  • Caching/memory: add batch-arena hard-cap + tail-compaction, pressure-aware pool retention, post-flush/checkpoint trimming, and iterator-rotation flush behavior.
  • Telemetry/tests: add/extend stats for mmap residency, deferred memtable bytes, adaptive memtable decisions, and add focused tests across packages.

Reviewed changes

Copilot reviewed 24 out of 24 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
cmd/unified_bench/main.go Adds batch-arena tail-compaction metrics to printed stat list.
TreeDB/zipper/zipper.go Introduces apply-lifetime merge scratch + pooled outer-leaf page buffers; updates merge APIs to use scratch-cloned split keys.
TreeDB/zipper/zipper_test.go Updates existing merge test for new signature and adds scratch reuse/trim tests.
TreeDB/internal/valuelog/reader_mmap.go Adds sealed-segment mmap budget controls and persistent-vs-sealed mmap gating; tracks dead mapped bytes.
TreeDB/internal/valuelog/manager.go Removes eager mmap on open; adds current-writable promotion, residency aggregation, and sealed mmap admission logic.
TreeDB/internal/valuelog/manager_test.go Adds tests for lazy-open behavior, current-writable promotion, residency aggregation, and sealed-budget ReadAt fallback.
TreeDB/db/api.go Exposes value-log mmap residency stats via DB.Stats().
TreeDB/internal/memtable/append_only.go Adds hard-reset path to drop retained buffers after spikes; used by caching recycle paths.
TreeDB/internal/memtable/append_only_reset_hard_test.go New test validating hard reset drops spike retention.
TreeDB/caching/db.go Adds pool-pressure controls, batch-arena hard caps + tail compaction, deferred-bytes telemetry, trimming after flush/checkpoint, adaptive decision telemetry, iterator rotation flush triggering, and value-log segment promotion on register.
TreeDB/caching/debug_memtable_rotate.go Adds optional debug logging for memtable rotations.
TreeDB/caching/debug_memtable_rotate_test.go Tests debug memtable mode labeling.
TreeDB/caching/pool_pressure_test.go Tests aux pool retention skipping under critical pressure.
TreeDB/caching/batch_arena_sizing_test.go Tests batch arena sizing clamping under critical pressure.
TreeDB/caching/batch_arena_ownership_test.go Tests retained hard-cap gating behavior across sustained writes and preflight blocking.
TreeDB/caching/batch_arena_budget_test.go Adds hard-cap, draining, tail-compaction, and global-lease tracking tests; updates max budget expectation.
TreeDB/caching/append_only_direct_writer_pool_test.go Adds oversize-drop + trimming + pressure-aware retention tests for append-only direct arena.
TreeDB/caching/retained_arena_trim_test.go New test covering trimming behavior after checkpoint flush path.
TreeDB/caching/iterator_rotation_flush_test.go New tests ensuring iterator-triggered rotations don’t let queue backlog grow unbounded.
TreeDB/caching/iterator_lease_test.go Extends iterator lease telemetry assertions to include deferred bytes.
TreeDB/caching/memtable_view_telemetry_test.go Updates tests for new deferred-bytes telemetry fields.
TreeDB/caching/backpressure_component_test.go Renames/extends test to cover empty-rotate vs non-empty rotate behavior.
TreeDB/caching/stats_test.go Adds test for adaptive BTree min-iterator-samples override behavior.
TreeDB/caching/vlog_generation_scheduler_test.go Adds test ensuring forced GC still runs when rewrite planning is canceled.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Copilot AI review requested due to automatic review settings March 17, 2026 18:42
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR bounds TreeDB’s file-backed RSS growth by making value-log mmaps lazy and budgeted, adds mmap residency telemetry, and tightens several cache/memtable retention behaviors to reduce post-spike memory.

Changes:

  • Value-log: lazy mmap on open, persistent mmap only for current-writable segments, sealed-segment lazy-mmap budget with ReadAt fallback, and exported residency stats.
  • Caching/memtable: hard-reset path for append-only reuse, pressure-aware pool retention, iterator-rotation flush behavior, and additional telemetry/stats.
  • Zipper/batch: new apply-lifetime scratch reuse (split keys + outer-leaf build pages) and batch-arena tail compaction + hard-cap gating.

Reviewed changes

Copilot reviewed 24 out of 24 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
cmd/unified_bench/main.go Adds new batch-arena tail compaction stat keys to unified bench output.
TreeDB/zipper/zipper.go Adds apply scratch reuse for merge split keys + outer-leaf page build buffers.
TreeDB/zipper/zipper_test.go Updates mergeLeaf signature usage and adds scratch reuse/trim tests.
TreeDB/internal/valuelog/reader_mmap.go Adds sealed lazy-mmap budget + persistent-mmap gating and env knob.
TreeDB/internal/valuelog/manager.go Tracks current-writable segment per lane, mmap residency stats, and lazy-mmap allowance logic.
TreeDB/internal/valuelog/manager_test.go Adds tests for lazy open, writable promotion, residency aggregation, and sealed budget fallback.
TreeDB/internal/memtable/append_only.go Adds “hard” reset policy to drop retained buffers after spikes.
TreeDB/internal/memtable/append_only_reset_hard_test.go Tests hard-reset behavior for append-only memtable.
TreeDB/db/api.go Exposes new value-log mmap budget and residency stats via DB stats.
TreeDB/caching/vlog_generation_scheduler_test.go Ensures forced GC can still run when rewrite planning is canceled.
TreeDB/caching/stats_test.go Adds test for adaptive BTree min-iterator-samples override behavior.
TreeDB/caching/retained_arena_trim_test.go Tests post-checkpoint trimming of append-only caches/arenas.
TreeDB/caching/pool_pressure_test.go Tests aux pool retention drops under critical pressure.
TreeDB/caching/memtable_view_telemetry_test.go Updates tests for deferred bytes telemetry tracking.
TreeDB/caching/iterator_rotation_flush_test.go Adds tests for iterator-triggered rotation + flush and shard enqueue filtering.
TreeDB/caching/iterator_lease_test.go Extends iterator lease tests to include deferred-bytes telemetry.
TreeDB/caching/debug_memtable_rotate_test.go Adds tests for memtable mode label helper used in debug logging.
TreeDB/caching/debug_memtable_rotate.go Adds optional stderr debug logging for memtable rotations.
TreeDB/caching/db.go Implements multiple retention/pressure controls, new stats, and iterator rotation flush behavior.
TreeDB/caching/batch_arena_sizing_test.go Tests batch arena chunk sizing clamp under critical pressure.
TreeDB/caching/batch_arena_ownership_test.go Tests batch-arena retained hard-cap behavior across sustained writes.
TreeDB/caching/batch_arena_budget_test.go Adds tests for draining, hard-cap gating, and tail compaction behavior.
TreeDB/caching/backpressure_component_test.go Updates test to reflect skipping empty units during flush/rotate.
TreeDB/caching/append_only_direct_writer_pool_test.go Adds tests for oversize chunk drops and pressure-aware retention limits.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0ff55a3125

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 45871cadef

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Copilot AI review requested due to automatic review settings March 18, 2026 00:24
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR reduces file-backed RSS by making value-log mmapping lazy and bounded (especially across sealed segments), while adding richer residency stats and several cache/memtable memory-retention controls and diagnostics.

Changes:

  • Value-log: lazily mmap segments, promote only the current writable segment per lane for persistent remaps, and enforce a capped sealed-segment lazy-mmap budget with ReadAt fallback.
  • Caching/memtable: add retained-buffer trimming (post-flush/checkpoint), batch-arena hard caps + tail-compaction, and adaptive memtable decision telemetry/tuning.
  • Add targeted tests covering mmap behavior, scratch/buffer reuse, trim policies, and new stats/telemetry.

Reviewed changes

Copilot reviewed 26 out of 26 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
cmd/unified_bench/main.go Exposes new batch-arena tail-compaction stats in unified bench output.
TreeDB/zipper/zipper.go Introduces apply-lifetime scratch + pooled outer-leaf build pages to reduce per-apply allocs.
TreeDB/zipper/zipper_test.go Adds tests for apply-scratch reuse and trimming behavior.
TreeDB/internal/valuelog/reader_mmap.go Adds sealed lazy-mmap budget + “persistent mmap” gating logic.
TreeDB/internal/valuelog/manager.go Tracks current writable per lane, exports mmap residency stats, and enforces sealed mapping budget.
TreeDB/internal/valuelog/manager_test.go Adds tests for residency aggregation, writable promotion, and sealed-budget fallback.
TreeDB/db/api.go Exposes new value-log mmap configuration/residency stats via DB stats.
TreeDB/internal/memtable/append_only.go Adds “hard reset” option to drop retained buffers and avoid spike retention.
TreeDB/internal/memtable/append_only_reset_hard_test.go Tests hard reset clamping and retained-chunk drop behavior.
TreeDB/caching/db.go Implements pool-pressure-aware retention policies, batch-arena hard caps, tail compaction, flush/checkpoint trimming, adaptive decision stats, and iterator-rotation flushing behavior.
TreeDB/caching/stats_test.go Tests adaptive BTREE min-iterator sample gate behavior and decision accounting.
TreeDB/caching/snapshot_test.go Updates tests to use atomic memtable-mode storage accessor.
TreeDB/caching/reverse_iterator_parity_test.go Updates tests to use atomic memtable-mode storage accessor.
TreeDB/caching/vlog_generation_scheduler_test.go Ensures canceling rewrite planning still runs forced GC and returns to idle state.
TreeDB/caching/retained_arena_trim_test.go Tests post-checkpoint trimming behavior for retained arenas and append-only leases.
TreeDB/caching/pool_pressure_test.go Tests that aux batch pools drop retention under critical pressure.
TreeDB/caching/memtable_view_telemetry_test.go Extends deferred view telemetry tests to include deferred bytes tracking.
TreeDB/caching/iterator_rotation_flush_test.go Adds tests verifying iterator-driven rotations trigger background flushing and avoid enqueuing empty shards.
TreeDB/caching/iterator_lease_test.go Extends iterator lease tests to validate deferred-bytes telemetry.
TreeDB/caching/debug_memtable_rotate.go Adds optional env-gated debug logging for memtable rotations.
TreeDB/caching/debug_memtable_rotate_test.go Tests memtable mode label helper used by debug logs.
TreeDB/caching/batch_arena_sizing_test.go Tests copy-arena chunk sizing clamps under critical pressure (while allowing large writes).
TreeDB/caching/batch_arena_ownership_test.go Tests batch-arena hard-cap behavior across sustained writes and preflight blocking.
TreeDB/caching/batch_arena_budget_test.go Adds tests for new draining, hard-cap, global leased tracking, and tail compaction.
TreeDB/caching/backpressure_component_test.go Updates flush test to reflect new “skip empty shards” semantics.
TreeDB/caching/append_only_direct_writer_pool_test.go Adds tests for oversize direct-arena chunk dropping and pressure-aware retention limits.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants