Repository navigation
feat: add confirmed replication barriers for hybrid write policies - #57
Conversation
ReviewI read through Code quality / designOverall this is a careful, well-scoped design:
Potential bugsI didn't find a functional bug. A few things I specifically checked and believe are correct:
Minor nits (non-blocking)
Test coverageThe test suite is notably thorough for a concurrency-heavy feature: whole-prefix barriers, independent concurrent waiters, ambiguous-append retry without false confirmation, checkpoint-outage retry, restart/generation isolation, chunk-boundary non-confirmation (both poll and tail paths), and history-read failures. The SecurityNothing concerning. Nice work — this is thorough and the documentation of the guarantee boundaries is a real strength. |
Review: Confirmed replication barriers (
|
ReviewI read through Code quality
Possible bugs / edge cases
Performance
Security
Test coverage
Overall this looks solid and unusually well-documented for a feature with sharp edges (durability inheritance, generation scoping, at-least-once redelivery). Nice work. |
Applications can keep ordinary writes asynchronous while waiting for selected writes to reach an independent replica.
Replicatorreuses Mirror's ordered copy loop and adds source-prefix barriers:Positionscopes an append result,Captureresolves a fixed tail,Waitwaits for destination acknowledgement plus a saved checkpoint, andConfirmedreports progress. Confirmed copying uses batched Read even for tail-capable sources so empty-chunk cursor advances remain visible; explicit waits wake idle polling without bypassing error backoff.Positions and checkpoints are scoped to an explicit relationship ID and log generation. Restart resumes the same checkpoint namespace; replacement logs require a new generation. Unfulfilled waiters wake when Run stops, canceled waiters do not stop copying, and failed later checkpoint saves retry in place without advancing confirmation. Plain Mirror retains its existing policy. Automatic rewind reset is rejected for confirmed replication.
A successful wait inherits the destination's storage acknowledgement guarantees. It does not provide writer fencing, snapshot transfer, destination-projection application, or protection from a destination that acknowledges before durable storage. Source history must remain intact; recovery must tolerate duplicate IDs.
Durable Streams gains opt-in
WithStrictDecoding()so a replication source cannot silently skip malformed envelopes. README, distributed/persistence/examples guides, a new Confirmed Replication guide, API comments, an executable example and the v0.19.0 changelog cover setup, hybrid policy, timeout/retry, generations and recovery constraints.Validation:
Release target: v0.19.0. Submodule requirements/tags will be aligned once the root tag is published, following the repository's existing multi-module release sequence.