Cluster Manager: fixed infinite loop in rebalance (Issue #4941).

This commit is contained in:
artix 2018-05-28 17:23:42 +02:00 committed by antirez
parent 3d5e2c62e2
commit 4bce88b11f

View File

@ -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--;
}