Skip to content

Commit

Permalink
Fix comments
Browse files Browse the repository at this point in the history
Signed-off-by: naglera <[email protected]>
  • Loading branch information
naglera committed Oct 14, 2024
1 parent 683b6ac commit bbc498f
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/replication.c
Original file line number Diff line number Diff line change
Expand Up @@ -2752,14 +2752,18 @@ static void dualChannelFullSyncWithPrimary(connection *conn) {
ret = dualChannelReplHandleEndOffsetResponse(conn, &err);
if (ret == C_OK) server.repl_rdb_channel_state = REPL_DUAL_CHANNEL_RDB_LOAD;
break;
default: break;
default:
serverPanic("Unexpected dual replication state: %d", server.repl_rdb_channel_state);
}
sdsfree(err);
if (ret == C_ERR) goto error;
sdsfree(err);
return;

error:
sdsfree(err);
if (err) {
serverLog(LL_WARNING, "Dual channel sync failed with error %s", err);
sdsfree(err);
}
if (server.repl_transfer_s) {
connClose(server.repl_transfer_s);
server.repl_transfer_s = NULL;
Expand Down Expand Up @@ -3309,9 +3313,7 @@ void dualChannelSetupMainConnForPsync(connection *conn) {
/* In case the RDB is already loaded, the repl_state will be set during establishPrimaryConnection. */
break;
default:
serverLog(LL_WARNING, "Unexpected replication state: %d", server.repl_state);
ret = C_ERR;
break;
serverPanic("Unexpected replication state: %d", server.repl_state);
}

if (ret == C_ERR) {
Expand Down

0 comments on commit bbc498f

Please sign in to comment.