From 4bce88b11fdf68ab754cf9125ffaac02c6428ff5 Mon Sep 17 00:00:00 2001 From: artix Date: Mon, 28 May 2018 17:23:42 +0200 Subject: [PATCH] Cluster Manager: fixed infinite loop in rebalance (Issue #4941). --- src/redis-cli.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/redis-cli.c b/src/redis-cli.c index d106d8f5d..e1c1983d5 100644 --- a/src/redis-cli.c +++ b/src/redis-cli.c @@ -4887,7 +4887,7 @@ static int clusterManagerCommandRebalance(int argc, char **argv) { listRewind(involved, &li); while ((ln = listNext(&li)) != NULL) { clusterManagerNode *n = ln->value; - if (n->balance < 0 && total_balance > 0) { + if (n->balance <= 0 && total_balance > 0) { n->balance--; total_balance--; }