Repository navigation
fix(6o-i): a capable replica never resumes inside a transaction group (PR 5) - #199
Merged
Merged
Conversation
…lica-atomic-apply
…ly (PR 4) apply_repl_group parses and checks every member first, takes the replication-order stripes of all of them once, checks the node still follows, then runs them through KeyValueStore::apply_transaction, the primary's own 6O-G boundary (inside without_expiry for an expirylog1 stream): one hold of the group's store stripes, marked, from its first member to its last. Readers of the replica (GET, MGET, EXISTS, TYPE, STRLEN, a client's borrowed reads) wait for or validate across it and never see part of a group. The first member that fails stops the rest; a failure or a panic ends the link with a protocol error (a full sync), latching persistence unhealthy only when there is an AOF. Then the effects: this node's AOF takes the group as one group, its sub-replicas get it with fan_out_group, then notifications and pushes per member. Design: benchmarks/v0.6.0/6o-i/V0.6O-I-PROTOCOL-DESIGN.md §6.4-§6.5.
… (PR 5) resume_frames refuses a partial synchronization to a txn1 replica whose first missing frame is a non-first member of a group (design §7.2 rule 2): it takes a full synchronization instead, counted in recached_replication_midgroup_resumes_total, whether or not the group's first frame is still in the backlog. A legacy replica resumes anywhere, as before. Tests: the design's worked example on the hub (with the backlog trimmed to the group's tail); a real primary's answer to resume points before, inside and after a group; a slow replica cut off inside a group by its queue resuming before it while its readers never see part of a transaction; a replica that applied a group resuming after it; a middle replica's full sync resetting its sub-replicas; a promoted middle replica grouping for its sub-replica.
…lica-atomic-apply
…imary's; a failed group converges every copy - C H1: a replica announces a group's keys through EXEC's own NotificationPlan (notify_replicated_group): each key once, at its last change, as its full value when the group changed it more than once, as removed_after_set when it was set then removed, FLUSHDB as the primary does. Whether a member removed its keys is decided right after it ran, inside the hold. Before, each member was announced after the whole group with its own delta: a delta live query ended with "abb" for SET a, APPEND b. - C M1 / D D-1: a group that fails or panics part-way resets this node's stream (sub-replicas take a full sync from a new run id, also if it is promoted first), closes its sync clients to rebuild and tells watchers the keyspace changed, as the primary's converge does. - C L2: the relay takes the group's frames without another copy (on_group_logged). - C L3: why the effects step is not cancellation-safe, and why that is acceptable. - C L1: tests for the delta live query, a WATCH invalidated by set-then- remove, a failed group on a middle replica promoted before it reconnects, and a failed group with an AOF (latch, prefix kept until the full sync).
…le 2 counted - D-3: the queue-overflow test is renamed and documented for what it shows (a replica whose queue overflows on groups resumes and converges, and its readers never see part of a transaction); a link ending inside a group is covered deterministically by PR 3's fake-primary test. - D-5: the real-primary rule-2 test asserts the partial/full sync counters for every resume point, not just the mode byte.
…s promoted, as run_repl_client does
…lica-atomic-apply
…lica-atomic-apply
akosidencio
marked this pull request as ready for review
November 26, 2026 14:03
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.
Phase 6O-I, PR 5: resynchronization at transaction-group boundaries. Design #195, §7.
Stacked: this branch merges PR 4 (and so #196 and #197). Its own changes are 7db53dc and 055cfba. It stays a draft until those merge. Review D is in round 2: round 1 was APPROVED WITH CHANGES, and its D-1 is fixed in PR 4 and D-2 in PR 3.
Changes
resume_framesrefuses a partial synchronization to atxn1replica whose first missing frame is a non-first member of a group. It gives a full sync instead, counted inrecached_replication_midgroup_resumes_total, whether or not the group's first frame is still retained. A legacy replica resumes anywhere, as before.Tests