Capture the slot's consistent point and split connect from streaming - #143
Merged
Conversation
Contributor
📊 Benchmark ResultsCurrent run is the minimum over 3 passes, compared against the base branch (
Summary: 🟢 3 faster · ➡️ 7 neutral · ⚪ 3 ignored (sub-μs) Thresholds: <1μs ignore · 1–20μs 15% · 20–50μs 10% · ≥50μs 5%. Measured on a shared CI runner — treat small deltas as noise. Informational only; this check never fails the build. |
Owner
Author
|
/bench |
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.
Groundwork for the initial snapshot (#49). A consistent snapshot needs the slot's exported consistent point and a seam to run the snapshot between slot creation and
START_REPLICATION. This PR adds both.replication_protocol.zig: read theCREATE_REPLICATION_SLOTresult row and keepconsistent_point, the slot's start LSN. Captured only when we create the slot; an existing slot leaves it null.source.zig: splitconnectintoconnectAndEnsureSlotandbeginReplicationso a caller can act between the two.connectstays as a thin wrapper for callers that pass an explicit start LSN (tests).main.zig: stream from the captured consistent point, falling back to0/0when the slot already existed.No behavior change on its own: for a fresh slot,
0/0already resolves to the same position. The value is the captured point and the connect split, which the snapshot PRs build on.