Skip to content

Conversation

@naglera
Copy link
Contributor

@naglera naglera commented Jun 9, 2025

When sending current offset to replica, use the last selected db sent to the replicas instead of always using server.db[0]->id. This fixes a potential issue where the dual channel sync relied on the primary always resending the SELECT command after PSYNC.

While the db id argument could be removed from the sync API, it's retained to maintain backward compatibility.

Fixed #2194.

@codecov
Copy link

codecov bot commented Jun 9, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 71.51%. Comparing base (ac2451b) to head (0452204).
Report is 2 commits behind head on unstable.

Additional details and impacted files
@@             Coverage Diff              @@
##           unstable    #2188      +/-   ##
============================================
- Coverage     71.55%   71.51%   -0.05%     
============================================
  Files           122      122              
  Lines         66493    66493              
============================================
- Hits          47579    47550      -29     
- Misses        18914    18943      +29     
Files with missing lines Coverage Δ
src/replication.c 86.60% <100.00%> (-0.04%) ⬇️

... and 15 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@naglera naglera force-pushed the init-fd branch 2 times, most recently from 4570f58 to 07cb2d4 Compare June 9, 2025 12:31
@enjoy-binbin enjoy-binbin requested a review from zuiderkwast June 10, 2025 07:58
@xbasel
Copy link
Member

xbasel commented Jun 10, 2025

@naglera please merge from unstable and resolve conflicts.

When sending current offset to replica, use the last selected db
sent to the replicas instead of always using `server.db[0]->id`. This
fixes a potential issue where the dual channel sync relied on
the primary always resending the SELECT command after PSYNC.

While the db id argument could be removed from the sync API,
it's retained to maintain backward compatibility.

Signed-off-by: naglera <[email protected]>
@enjoy-binbin enjoy-binbin merged commit 7bc34cf into valkey-io:unstable Jun 11, 2025
49 checks passed
chzhoo pushed a commit to chzhoo/valkey that referenced this pull request Jun 12, 2025
…2188)

When sending current offset to replica, use the last selected db sent to
the replicas instead of always using `server.db[0]->id`. This fixes a
potential issue where the dual channel sync relied on the primary always
resending the `SELECT` command after PSYNC.

While the db id argument could be removed from the sync API, it's
retained to maintain backward compatibility.

Fixed valkey-io#2194.

Signed-off-by: naglera <[email protected]>
Signed-off-by: chzhoo <[email protected]>
shanwan1 pushed a commit to shanwan1/valkey that referenced this pull request Jun 13, 2025
…2188)

When sending current offset to replica, use the last selected db sent to
the replicas instead of always using `server.db[0]->id`. This fixes a
potential issue where the dual channel sync relied on the primary always
resending the `SELECT` command after PSYNC.

While the db id argument could be removed from the sync API, it's
retained to maintain backward compatibility.

Fixed valkey-io#2194.

Signed-off-by: naglera <[email protected]>
Signed-off-by: shanwan1 <[email protected]>
ranshid pushed a commit to ranshid/valkey that referenced this pull request Jun 18, 2025
…2188)

When sending current offset to replica, use the last selected db sent to
the replicas instead of always using `server.db[0]->id`. This fixes a
potential issue where the dual channel sync relied on the primary always
resending the `SELECT` command after PSYNC.

While the db id argument could be removed from the sync API, it's
retained to maintain backward compatibility.

Fixed valkey-io#2194.

Signed-off-by: naglera <[email protected]>
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.

Send the database ID of the last replicated item (i.e. server.replicas_eldb) to replica

5 participants