Skip to content

Commit 54da834

Browse files
authored
Fix double MOVED reply on unblock at failover (#2734)
#2329 intoduced a bug that causes a blocked client in cluster mode to receive two MOVED redirects instead of one. This was not seen in tests, except in the reply schema validator. The fix makes sure the client's pending command is cleared after sending the MOVED redirect, to prevent if from being reprocessed. Fixes #2676. --------- Signed-off-by: Viktor Söderqvist <[email protected]>
1 parent ccf6fca commit 54da834

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/blocked.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ void disconnectOrRedirectAllBlockedClients(void) {
340340

341341
if (server.cluster_enabled) {
342342
if (clusterRedirectBlockedClientIfNeeded(c))
343-
unblockClient(c, 1);
343+
unblockClientOnError(c, NULL);
344344
} else {
345345
/* if the client is read-only and blocked by a read command, we do not unblock it */
346346
if (c->flag.readonly && !(c->lastcmd->flags & CMD_WRITE)) continue;

0 commit comments

Comments
 (0)