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.
This commit is contained in:
antirez 2016-12-02 10:21:20 +01:00
parent 71e8d15e49
commit 434e6b2da3

View File

@ -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;