diff --git a/src/server.c b/src/server.c index 0a148ae334..43d79aa2bc 100644 --- a/src/server.c +++ b/src/server.c @@ -3963,13 +3963,6 @@ int processCommand(client *c) { * and then resume the execution. */ blockPostponeClient(c); } else { - if (c->cmd->proc == execCommand) { - discardTransaction(c); - } else { - flagTransaction(c); - } - c->duration = 0; - c->cmd->rejected_calls++; addReplyErrorSds(c, sdscatprintf(sdsempty(), "-REDIRECT %s:%d", server.primary_host, server.primary_port)); } return C_OK; diff --git a/tests/integration/replica-redirect.tcl b/tests/integration/replica-redirect.tcl index b4e5a74b66..579880c69b 100644 --- a/tests/integration/replica-redirect.tcl +++ b/tests/integration/replica-redirect.tcl @@ -9,6 +9,10 @@ start_server {tags {needs:repl external:skip}} { set replica_port [srv 0 port] set replica_pid [srv 0 pid] + set replica_host [srv 0 host] + set replica_port [srv 0 port] + set replica_pid [srv 0 pid] + test {write command inside MULTI is QUEUED, EXEC should be REDIRECT} { set rr [valkey_client] $rr client capa redirect