Skip to content

Commit

Permalink
Allow abort sync connection from rdb con sync
Browse files Browse the repository at this point in the history
  • Loading branch information
amitnagl committed Apr 21, 2024
1 parent 08885c5 commit eb28c91
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/replication.c
Original file line number Diff line number Diff line change
Expand Up @@ -3707,7 +3707,8 @@ void undoConnectWithMaster(void) {
* Never call this function directly, use cancelReplicationHandshake() instead.
*/
void replicationAbortSyncTransfer(void) {
serverAssert(server.repl_state == REPL_STATE_TRANSFER);
serverAssert(server.repl_state == REPL_STATE_TRANSFER ||
server.repl_rdb_conn_state != REPL_RDB_CONN_STATE_NONE);
undoConnectWithMaster();
if (server.repl_transfer_fd!=-1) {
close(server.repl_transfer_fd);
Expand Down

0 comments on commit eb28c91

Please sign in to comment.