Improve replication since_seq parameter#5881
Merged
jiahuili430 merged 1 commit intomainfrom Feb 13, 2026
Merged
Conversation
36127dd to
5ad169b
Compare
big-r81
reviewed
Feb 6, 2026
since_seq parameter
nickva
reviewed
Feb 6, 2026
rnewson
reviewed
Feb 7, 2026
d171417 to
d0217ec
Compare
nickva
reviewed
Feb 11, 2026
d0217ec to
a0a0077
Compare
rnewson
reviewed
Feb 12, 2026
a0a0077 to
56e7732
Compare
- If there is no checkpoint and no `since_seq`, then replicate from scratch. - If there is no checkpoint but `since_seq` is defined, then replicate with the `since_seq` field. - If both checkpoint and `since_seq` exist, use the checkpoint to replicate. - If the request includes `since_seq` field, the replication ID will be changed.
56e7732 to
daf4ad1
Compare
nickva
approved these changes
Feb 13, 2026
| end, | ||
| ok = couch_replicator_scheduler:remove_job(Rep#rep.id). | ||
| ok = couch_replicator_scheduler:remove_job(Rep#rep.id), | ||
| {ok, Rep#rep.id}. |
Contributor
There was a problem hiding this comment.
Very neat idea so we can compare replication IDs!
Contributor
Author
There was a problem hiding this comment.
Thanks to your original code, it's very concise and easy to extend! I reused most of them.
Contributor
|
Let's wait for @rnewson's review as well since this implements his idea |
rnewson
approved these changes
Feb 13, 2026
Member
rnewson
left a comment
There was a problem hiding this comment.
very neatly done and a welcome improvement to since_seq behaviour.
I spun up a 3 node dev cluster and took this through some manual testing and observed the correct behavior.
Specifically;
- I made a database and filled it with thousands of documents
- I called _replicate with source/target and a since_seq of the current update seq of the db after step 1
- I observed that the response correctly said "no_changes". and no checkpoint was made, as no work was done.
- I then added ten more documents.
- I called _replicate against with same args as step 2 and the response correctly said docs_read:10 and docs_written:10. the log confirmed it called _changes with my original since_seq
- I did step 5 again and got a "no_changes" response and confirmed in the log that _changes was called with the update_seq from the checkpoint made at the end of step 5.
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.
Overview
since_seq, then replicate from scratch.since_seqis defined, then replicate withthe
since_seqfield.since_seqexist, use the checkpoint to replicate.since_seqfield, the replication ID will be changed.Testing recommendations
Related Issues or Pull Requests
Related issue: #5867
Checklist
rel/overlay/etc/default.inisrc/docsfolder