Skip to content

Commit

Permalink
simplify error message
Browse files Browse the repository at this point in the history
Signed-off-by: zhaozhao.zz <[email protected]>
  • Loading branch information
soloestoy committed Dec 16, 2024
1 parent 3925990 commit 4484886
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 1 addition & 3 deletions src/cluster.c
Original file line number Diff line number Diff line change
Expand Up @@ -1482,9 +1482,7 @@ void readonlyCommand(client *c) {
/* The READWRITE command just clears the READONLY command state. */
void readwriteCommand(client *c) {
if (server.cluster_enabled == 0 && !(c->capa & CLIENT_CAPA_REDIRECT)) {
addReplyError(c, "This instance has cluster support disabled,"
" you need to execute the CLIENT CAPA REDIRECT command,"
" before you can use the READWRITE command in standalone mode.");
addReplyError(c, "Redirects are not enabled");
return;
}
c->flag.readonly = 0;
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/replica-redirect.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ start_server {tags {needs:repl external:skip}} {
set replica_pid [srv 0 pid]

test {READONLY and READWRITE commands are disabled by default} {
assert_error {*cluster*disabled*READONLY*standalone*} {r readonly}
assert_error {*cluster*disabled*READWRITE*standalone*} {r readwrite}
assert_error {*Redirects are not enabled} {r readonly}
assert_error {*Redirects are not enabled} {r readwrite}
}

test {write command inside MULTI is QUEUED, EXEC should be REDIRECT} {
Expand Down

0 comments on commit 4484886

Please sign in to comment.