Skip to content

Improve replication since_seq parameter#5881

Draft
jiahuili430 wants to merge 2 commits intomainfrom
improve-replication
Draft

Improve replication since_seq parameter#5881
jiahuili430 wants to merge 2 commits intomainfrom
improve-replication

Conversation

@jiahuili430
Copy link
Contributor

Overview

Testing recommendations

Related Issues or Pull Requests

Checklist

  • This is my own work, I did not use AI, LLM's or similar technology
  • Code is written and works correctly
  • Changes are covered by tests
  • Any new configurable parameters are documented in rel/overlay/etc/default.ini
  • Documentation changes were made in the src/docs folder
  • Documentation changes were backported (separated PR) to affected branches

% Worker children get a default 5 second shutdown timeout, so pick a value just
% a bit less than that: 4.5 seconds. In couch_replicator_sup our scheduler
% worker doesn't specify the timeout, so it up picks ups the OTP default of 5
% worker doesn't specify the timeout, so it picks ups the OTP default of 5
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/ups/up ?

@jiahuili430 jiahuili430 changed the title Improve replication Improve replication since_seq parameter Feb 6, 2026

StartSeq1 = get_value(since_seq, Options, StartSeq0),
StartSeq = {0, StartSeq1},
StartSeq2 =
Copy link
Contributor

@nickva nickva Feb 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't in general compare sequences. But we can compare with 0 if we're starting from scratch. We should use == 0.

Based on the discussion in #5867 we'd want something like this:

If there is a checkpoint (StartSeq0 =/= 0) use the checkpoint and ignore since_seq. Otherwise (no checkpoint) and user specified a since_seq, use the since_seq

In addition make sure the since_seq is folded into the replication ID (append to the list if it's there but if it isn't make sure to generate the same replication ID as before). This will rewind changes for a existing replications with since_seq back to 0. So it's something to warn the users about in the release notes.

% exception which would indicate this document is malformed. This exception
% should propagate to db_change function and will be recorded as permanent
% failure in the document. User will have to update the documet to fix the
% failure in the document. User will have to update the document to fix the
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please make the many (and welcome!) documentation fixes in a separate PR to the one making the since_seq enhancement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants