Repository navigation
fix(stream): start EARLIEST on an empty log at its first row - #100
Merged
Merged
Conversation
The server refused EARLIEST on a log holding nothing as empty, and a client that then subscribed "from now", as the refusal advised, missed any row committed between the refusal and the second subscribe: in neither the replay nor the live queue. The keyed-table example failed intermittently in CI on exactly this, and Stream.live had the same race at open. EARLIEST with nothing to replay now starts at the frontier read before the subscriber joins: an empty replay, or one carrying whatever committed in between. Clients keep understanding empty from an older server, with a message that names the race; the examples drop their fallback. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FsSDkeb5rVAxA1FSmKKfQi
Merged
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.
Fixes the CI failure on main (run 37230675435):
test_keyed_table_examplestimed out with "offset 3 not applied in 10s (at None)".Cause.
EARLIESTon a log that held nothing was refused withempty, and the examples fell back to subscribing from now. A row committed between the refusal and the second subscribe was in neither, so the view never saw it.Fix.
EARLIESTon an empty log starts at the log's first row, and that holds for an evicted log that has run dry too._resolvereads the frontier before its awaits, so a row committed while it resolves is at or above the frontier, and the replay to the frontier at attach (I2) carries it. The examples' fallback is removed.Live._connectkeeps its fallback for an older broker, which still refuses withempty.test_EARLIEST_on_a_log_that_holds_nothing_starts_at_its_first_rowtest_a_row_committed_while_EARLIEST_resolves_is_not_lostholdsearliestopen while 3 rows commit. Both tests fail against the old refusal, and the race test also fails against a live-only start.EARLIESTon an empty log to provoke a refusal now use an offset ahead of the log.whyvalues in README, SPEC and API, plus a CHANGELOG entry under Unreleased.🤖 Generated with Claude Code
https://claude.ai/code/session_01FsSDkeb5rVAxA1FSmKKfQi