From 8f7e97258b0b71b907a67b3078fe6374c77b9972 Mon Sep 17 00:00:00 2001 From: chendianqiang Date: Wed, 27 Feb 2019 17:43:05 +0800 Subject: [PATCH] fix replicationid will not change for server.masterhost==NULL in cluster mode when restart slave --- src/server.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server.c b/src/server.c index 2ff1aeb08..b3c9e772b 100644 --- a/src/server.c +++ b/src/server.c @@ -4556,7 +4556,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