File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -956,6 +956,14 @@ int slaveTryPartialResynchronization(int fd) {
956
956
if (!runid || !offset || (offset - runid - 1 ) != REDIS_RUN_ID_SIZE ) {
957
957
redisLog (REDIS_WARNING ,
958
958
"Master replied with wrong +FULLRESYNC syntax." );
959
+ sdsfree (reply );
960
+ /* This is an unexpected condition, actually the +FULLRESYNC
961
+ * reply means that the master supports PSYNC, but the reply
962
+ * format seems wrong. To stay safe we blank the master
963
+ * runid to make sure next PSYNCs will fail, and return
964
+ * NOT_SUPPORTED to the caller to use SYNC instead. */
965
+ memset (server .repl_master_runid ,0 ,REDIS_RUN_ID_SIZE + 1 );
966
+ return PSYNC_NOT_SUPPORTED ;
959
967
} else {
960
968
memcpy (server .repl_master_runid , runid , offset - runid - 1 );
961
969
server .repl_master_runid [REDIS_RUN_ID_SIZE ] = '\0' ;
You can’t perform that action at this time.
0 commit comments