Don't send REPLCONF ACK to old masters.

Masters not understanding REPLCONF ACK will reply with errors to our
requests causing a number of possible issues.

This commit detects a global replication offest set to -1 at the end of
the replication, and marks the client representing the master with the
REDIS_PRE_PSYNC flag.

Note that this flag was called REDIS_PRE_PSYNC_SLAVE but now it is just
REDIS_PRE_PSYNC as it is used for both slaves and masters starting with
this commit.

This commit fixes issue #1488.
This commit is contained in:
antirez
2014-01-08 14:25:06 +01:00
parent 418d3d358a
commit 2a1a31ca9d
2 changed files with 12 additions and 5 deletions

View File

@ -229,7 +229,7 @@
#define REDIS_MASTER_FORCE_REPLY (1<<13) /* Queue replies even if is master */
#define REDIS_FORCE_AOF (1<<14) /* Force AOF propagation of current cmd. */
#define REDIS_FORCE_REPL (1<<15) /* Force replication of current cmd. */
#define REDIS_PRE_PSYNC_SLAVE (1<<16) /* Slave don't understand PSYNC. */
#define REDIS_PRE_PSYNC (1<<16) /* Instance don't understand PSYNC. */
/* Client request types */
#define REDIS_REQ_INLINE 1