From f004073b54ee0b09afcb3789a8d835fd6018e99e Mon Sep 17 00:00:00 2001 From: Binbin Date: Tue, 22 Jun 2021 05:02:44 +0800 Subject: [PATCH] Check cluster_enabled in readwriteCommand just like readonlyCommand. (#9015) --- src/cluster.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/cluster.c b/src/cluster.c index 1dce37a2fb..7612ab91d1 100644 --- a/src/cluster.c +++ b/src/cluster.c @@ -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); }