Commit 2ca21753 authored by chendianqiang's avatar chendianqiang Committed by antirez
Browse files

fix replicationid will not change for server.masterhost==NULL in cluster mode when restart slave

parent 44c5bce0
...@@ -3859,7 +3859,7 @@ void loadDataFromDisk(void) { ...@@ -3859,7 +3859,7 @@ void loadDataFromDisk(void) {
(float)(ustime()-start)/1000000); (float)(ustime()-start)/1000000);
/* Restore the replication ID / offset from the RDB file. */ /* Restore the replication ID / offset from the RDB file. */
if (server.masterhost && if ((server.masterhost || (server.cluster_enabled && nodeIsSlave(server.cluster->myself)))&&
rsi.repl_id_is_set && rsi.repl_id_is_set &&
rsi.repl_offset != -1 && rsi.repl_offset != -1 &&
/* Note that older implementations may save a repl_stream_db /* Note that older implementations may save a repl_stream_db
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment