postgres=# select * from sessions where video_id = 'pVFH6VwjgwM';

B-tree merge: correctness first

· 50:19 · Storage internals

Test Salma El-Sayed’s B-tree leaf-page merge prototype: snapshots, parallel scans, VACUUM, and standby safety.

session summary

Nik Samokhvalov, Kirk Wolak, and Salma El-Sayed tested the B-tree leaf-page merge prototype and agreed to prioritize correctness before benchmarks. The discussion covered boundary pivots, merge-group metadata, concurrent readers, and deferred VACUUM cleanup. Nik reported standby and parallel-scan failures; the group examined index-only-scan snapshot safety and the lifetime of pinned pages. The next step is focused reproduction, small fixes, and retesting against exact revisions, not a claim that the prototype is ready to ship.

Based on October 14 session summary and action items. Caption-backed timecodes are not available yet.

timecodes

Timecodes pending.

discussion and decisions

Current design, not a settled SQL interface

Salma described a boundary pivot and merge-group metadata replacing the earlier fix-up approach. The current prototype merges left into right under the same parent. Merges are explicitly invoked; VACUUM performs later cleanup. Automatic initiation and final SQL syntax remain design questions.

Logical states and cleanup ordering

Merge, half-dead, deleted, and reusable describe logical states, not a requirement for separate VACUUM runs. The group emphasized retaining merge-group relationships until cleanup is safe, including interrupted cleanup and intermediate states.

Correct results, not just clean amcheck

Long-lived snapshots, index-only and parallel scans, direction changes, rescans, and concurrent VACUUM need independent result comparisons. A successful amcheck run or absence of a crash is not sufficient evidence of correctness.

Reported during the call

Nik reported a standby PANIC and parallel-scan wrong results. Salma suggested missing first-page merge-state publication as one possible explanation, not a verified fix. The group located Oleg’s index-only-scan reproducer and discussed the reverted cleanup-lock change.

Campaign follow-ups: scan correctness

The session notes also link follow-up reports recorded after the live discussion. These cover parallel merge-skip state, cursor direction changes, and merge-join mark/restore. This is not a claim that every report was discussed on air; each issue has its own revision, evidence, and validation status.

follow-up from this session

Owners and targets from the session notes. Targets are plans, not completed releases.

  • Nik / testing — Continue campaign #101 with exact revisions and small reproducible cases in linked issues.Correctness first
  • Nik / testing — Run the original repro_ios_merge_vacuum.py; compare index-only and ordinary scans on primary and standby, including the cleanup-lock change.See #107
  • Testing — Run existing merge tests, including 008_btree_merge; fix missing Meson registration and separate test-side failures from server defects.See #101
  • Testing — Check ordinary and parallel scans, forward/backward movement, rescans, long transactions, isolation levels, and pg_dump against an independent oracle.Reproduce and compare results
  • Testing — Cover interrupted cleanup, page reuse, merge-group invariants, WAL replay, and standby behavior. Add tests that invalid structures are detected.Exact code and intermediate states
  • Salma / development — Investigate linked reports, prepare focused fixes, and notify Nik when revisions are available.For retesting
  • Nik / testing — Rerun original reproducers against each fix and explore related failure modes; do not close findings on source inspection alone.After each revision
  • Documentation — Update the stale visualization and introduce merge behavior, readers, cleanup, and WAL/standby concepts gradually.Follow-up
  • Nik — Explore a notification bridge to the broader Salma hacking Telegram group. No bridge was deployed during this session.Idea to evaluate
  • All — Benchmark comparable builds and workloads after correctness work.After correctness validation