Repository navigation
Advance freshness on bootstrap and on applies that drain the slot (RD-3) - #51
Merged
Merged
Conversation
Authority.publish takes an optional observed_at (authority ms) and moves doc['updated'] to it, refusing a future observation before commit. Bootstrap passes the authority time read before CREATE_REPLICATION_SLOT; an apply passes the poll's view time only when its peek showed the transaction was the last one through the frontier (the peek now reads two rows to tell); advance_idle passes it too. A backlogged apply still does not reset freshness. Before this, continuous writes with no idle poll froze 'updated' and every read missed with source_lag_limit after 30 s. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0194kAmY4QqQGabdoB3xGFsr
Owner
Author
|
This failure is not from this PR. It is the known drain-rate limit on Generated by Claude Code |
dbccpage
marked this pull request as ready for review
November 11, 2026 10:07
peek_many now reports whether its batch drained the slot through the frontier (every decoded row admitted and fewer than max_coalesce rows), and the worker passes the poll's observation time to apply_many only then. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0194kAmY4QqQGabdoB3xGFsr
Base automatically changed from
claude/rd2-signed-head-bootstrap-and-withdraw
to
main
November 11, 2026 11:07
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.
Requested by Jeremy · project thread
Stacked on #49 (which is stacked on #48). Only the last commit is new here.
What
Authority.publish(..., observed_at=None): optional freshness in authority ms. It movesdoc["updated"]forward (never back) and refuses a future observation asinvalid_freshness_observationbefore commit.CREATE_REPLICATION_SLOT: every commit before it is inside the exported snapshot.peeknow reads two rows and returns(payload, offset, exhausted). A backlogged apply still does not reset freshness (test_backlog_publication_does_not_reset_source_freshnessunchanged).advance_idlepasses it too.Evidence (local PG 16.15 + wal2json + Redis 7)
New
test_production_continuous_writes_keep_bounded_reads_fresh_past_max_lag: 35 s of writes at 4 tx/s with the idle path (advance_idle+caught_up) disabled, which models "a commit in every poll". Bounded hit rate in [30 s, 35 s]:head_miss; the head is withdrawn withsource_lag_limit)Unit test
test_publication_with_an_observation_advances_freshness. Full native suite (non-cluster, non-disruptive): 58 passed.test_production_read_contention_during_publication[bounded]failed once in 2 runs. It is the known drain-rate flake: about 25 tx/s drain against 20 writes/s, unchanged by this PR (phase profile 24.3 to 26.4 tx/s on both branches). The fix for that is the batching in #47.Not in this PR
tests/production_native.py::bounded()already builds oneSignedMirrorper test, and the CLI does not use signed heads. I found no per-poll instantiation to fix.Generated by Claude Code