fix: ignore excluded raw ring slot - #129
Conversation
cc80a64 to
2006159
Compare
Rebased by hand onto RED on the rebased base: GREEN on
Caveats accepted explicitly: this does not fix #128's time-bound path, so #128 stays open. Moving the boundary newer makes #163 strictly worse; #163 must be fixed with or immediately after this PR. Frozen 1.x installers still carry the old two-slot helper body and are now load-bearing migration fragility. |
|
Heads-up — merging this will require a one-line test change once #219 lands. #219 (fixes #212) redefines This PR's assertion that Composition was tested against this PR's head Recommended order: this PR first, then #219. Note also that this PR moves the boundary newer, which makes #212 strictly worse in the interim — so they should land close together. Context: #160. |
What changed
ash._active_slots()enumerate the configured retained ring offsets0 .. num_partitions - 2ash._raw_retention_start()to that exact readable slot setWhy
The physical oldest ring slot remains populated until its next truncate but is deliberately excluded from raw readers. Including it in the retention minimum made
status()and report coverage advertise unreadable history and allowed old event/query tie drills to pass the guard before returning a silent zero.Impact
Raw-retention metadata now describes data the reader helpers can actually access. An event/query tie drill over excluded history raises the documented outside-retention error.
This PR intentionally does not fix the time-bound path from #128. It also moves the boundary newer, making the partial-first-minute defect in #163 strictly worse; #163 must be fixed with or immediately after this change. Frozen 1.x installers still contain the old two-slot
_active_slots()body and must not be reapplied as a terminal installer over 2.0.Validation
Postgres 17.9 after rebasing onto
origin/mainatce541ac:got {2,1}2006159:_active_slots()returns exact{2,1,0,5,4}and the complete named retention regression exits 0{0,2}, helper/status agreement, and the outside-retention errorgit diff --checkpasscodex review --base origin/mainreports no introduced correctness issueRefs #128