Check cluster_enabled in readwriteCommand just like readonlyCommand. (#9015)

This commit is contained in:
Binbin 2021-06-22 05:02:44 +08:00 committed by GitHub
parent 96bb078577
commit f004073b54
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -5734,6 +5734,10 @@ void readonlyCommand(client *c) {
/* The READWRITE command just clears the READONLY command state. */
void readwriteCommand(client *c) {
if (server.cluster_enabled == 0) {
addReplyError(c,"This instance has cluster support disabled");
return;
}
c->flags &= ~CLIENT_READONLY;
addReply(c,shared.ok);
}