Repository navigation
feat(6o-i): a capable replica applies each transaction group atomically (PR 4) - #198
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.
…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).
…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 4: a capable replica applies each transaction group atomically. Design #195, §6.4–§6.5.
Stacked: this branch merges #196 (PR 2) and #197 (PR 3). Its own changes are the commits after those merges: 6c4b89f, cc58268 and 02d01bb. It stays a draft until #196 and #197 merge.
Review C: APPROVED in round 2. Round 1 was APPROVED WITH CHANGES, with one High (H1) and one Medium (M1); both are fixed and confirmed by the reviewer, who checked that reverting either fix makes its new test fail.
Changes
apply_repl_groupparses and checks every member, takes onelock_commandsfor the group, checksstill_followingonce, then runsKeyValueStore::apply_transaction. That is the primary's own 6O-G boundary, run insidewithout_expiryforexpirylog1. Readers of a replica never see part of a group.on_group_logged,fan_out_group), then WATCH/QSUB notifications coalesced exactly asEXEC's (notify_replicated_groupreusesNotificationPlan; review C H1), then pushes.Tests
tests/replica_atomicity_6oi.rs: