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

This commit is contained in:
chendianqiang
2019-03-01 17:30:32 +01:00
committed by antirez
parent 44c5bce0f4
commit 2ca2175362
+1 -1
View File
@@ -3859,7 +3859,7 @@ void loadDataFromDisk(void) {
(float)(ustime()-start)/1000000);
/* 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_offset != -1 &&
/* Note that older implementations may save a repl_stream_db