From 434e6b2da368bbcf4d8aa6153f39e0479deb063b Mon Sep 17 00:00:00 2001 From: antirez Date: Fri, 2 Dec 2016 10:21:20 +0100 Subject: [PATCH] PSYNC2: Do not accept WAIT in slave instances. No longer makes sense since writable slaves only do local writes now: writes are no longer passed to sub-slaves in the stream. --- src/replication.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/replication.c b/src/replication.c index 28a37786..94287f9d 100644 --- a/src/replication.c +++ b/src/replication.c @@ -2362,6 +2362,11 @@ void waitCommand(client *c) { long numreplicas, ackreplicas; long long offset = c->woff; + if (server.masterhost) { + addReplyError(c,"WAIT cannot be used with slave instances. Please also note that since Redis 4.0 if a slave is configured to be writable (which is not the default) writes to slaves are just local and are not propagated."); + return; + } + /* Argument parsing. */ if (getLongFromObjectOrReply(c,c->argv[1],&numreplicas,NULL) != C_OK) return;