Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Verification
Review status
This draft covers diagnostic retention. Family reclamation and owner release remain in #145.
Each migration uses normal
CREATE INDEX, so the index build can block writes. The first loaded PostgreSQL rehearsal found that building both indexes in one transaction deadlocked with an actual released writer. The split migrations completed on PostgreSQL and SQLite with zero foreground failures. The fixture had 24,000 retained flows and 1.212 million history rows. Both runs removed 294,000 eligible rows.The migration decision is cold. Drain active Dataflow writers before the ordinary index builds. The split removes the observed deadlock, and the builds still take write-blocking locks. Steady sweeps run after that schema work and have their own foreground contention profile. PostgreSQL retains the existing table lock. SQLite uses its existing writer reservation. Protected diagnostics can be scanned again on later passes, and one wide family can require work beyond the candidate page size.
Steady PostgreSQL control
Each trial cloned the same populated history and ran the ordinary released Dataflow 0.7.38 foreground writer. The benchmark repeatedly invoked the released sweeper and used a roughly 15-second observation window. Released production cadence invokes one paired batch per scheduled pass. The candidate measurements use 1,000 rows per page and a 1 ms pause. The advisory prototype is a separate local experiment that selects possible candidates before acquiring the writer lock and rechecks their eligibility inside it.
The advisory read reduced writer transactions to 235 across 1,126 raw pages when the diagnostic owner itself was waiting. An old terminal owner with a waiting sibling or descendant still required a locked family read for all 408 sampled pages. It stopped inside the 450,000-row protected prefix. Both approaches preserved those rows. The lower p95 in the advisory sibling/descendant trial came with zero deletion work. Keep the advisory experiment local.
The draft's same-page dry run reached 906 pages at 371 ms foreground p95. The destructive run reached 534 pages at 641 ms p95. Sampled foreground waits while maintenance was committing fell from 283 to zero in the dry run. The released control usually blocked its writer in the global eligibility query. The draft shifts observed contention toward transaction commit and repeated lock acquisition. These fixtures do not establish production latency. The PR remains draft for review.