Skip to content

Commit

Permalink
Fix race condition dualChannelSync abort after local replication buff…
Browse files Browse the repository at this point in the history
…er stream

Signed-off-by: Ubuntu <[email protected]>
  • Loading branch information
Ubuntu committed Jul 23, 2024
1 parent 7cd8c5e commit 534596c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/replication.c
Original file line number Diff line number Diff line change
Expand Up @@ -2862,6 +2862,8 @@ void dualChannelSyncSuccess(void) {
if (streamReplDataBufToDb(server.primary) == C_ERR) {
/* Sync session aborted during repl data streaming. */
serverLog(LL_WARNING, "Failed to stream local replication buffer into memory");
replicationAbortDualChannelSyncTransfer();
replicationUnsetPrimary();
return;
}
freePendingReplDataBuf();
Expand Down
3 changes: 3 additions & 0 deletions tests/integration/replication-buffer.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ start_server {} {
# Make sure replica3 is synchronized with master
$replica3 replicaof $master_host $master_port
wait_for_sync $replica3
if {$dualchannel == "yes"} {
wait_for_ofs_sync $master $replica3
}

# Generating RDB will take some 100 seconds
$master config set rdb-key-save-delay 1000000
Expand Down

0 comments on commit 534596c

Please sign in to comment.