fix: distinguish due Wire rows from FIFO eligible heads - #455
Open
CountableNewt wants to merge 2 commits into
Open
CountableNewt wants to merge 2 commits into
CountableNewt wants to merge 2 commits into
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.
Existing Wire backlog telemetry counts due rows even when a future retry or active lease blocks them in repository FIFO order. Add a read-only operational diagnostic that separates sampled due rows, FIFO-eligible heads, and blocked followers without changing public health response shapes or hiding retained work.
The SQL selects up to 65 rows through each existing due index, checks up to 64 per branch with a bounded lateral predecessor seek, and reports truncation, the observation cutoff, and sampled age lower bounds. A zero eligible sample is explicitly inconclusive when truncated. It emits no identifiers or payloads, takes no claim locks, and uses a three-second statement timeout plus a 500ms lock timeout. No migration, cleanup, retry, or reconciliation occurs.
Five PostgreSQL tests cover future-retry/live-lease barriers, expired leases, terminal predecessors, source/environment isolation, unchanged durable rows, empty/64-row/truncated samples, and existing-index plans over a 20,200-row fixture. They run in the existing Database Migrator CI harness using a fresh isolated local database. All five PostgreSQL fixtures passed in CI run34918985303, Database Migrator job104222787217, including the 20,200-row EXPLAIN ANALYZE test using all three expected indexes without sequential scans. The combined migration/diagnostic harness passed 10 tests with 0 failures. Local syntax and diff checks also pass; local Docker was unavailable, so this PostgreSQL evidence comes from CI. The full aggregate Required gate remains pending other jobs.
This completes the diagnostics portion of TSW-122 alongside the separate classification PR451 and its Development companion. Coordinate promotion with those staged changes; required CI must pass. It does not change due-row telemetry labels or assert a sampled FIFO-eligible head can acquire a currently held claim lock.
Production catalog verification confirmed all three expected indexes valid and ready. One authorized read-only sample at 2026-09-15T02:00:06.467107Z found 0 due rows and no truncation. This database-wide result includes historical generations and does not establish current-lane freshness, recovery completeness, or absence of future retries/active leases. No hosted mutation occurred.