Skip to content

Commit

Permalink
standalone -REDIRECT handles special case of MULTI context
Browse files Browse the repository at this point in the history
  • Loading branch information
soloestoy committed Aug 12, 2024
1 parent 5166d48 commit 360f9fc
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/server.c
Original file line number Diff line number Diff line change
Expand Up @@ -3911,6 +3911,13 @@ int processCommand(client *c) {

if (!server.cluster_enabled && c->capa & CLIENT_CAPA_REDIRECT && server.primary_host && !mustObeyClient(c) &&
(is_write_command || (is_read_command && !c->flag.readonly))) {
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;
}
Expand Down

0 comments on commit 360f9fc

Please sign in to comment.