Commit 4bce88b1 authored by artix's avatar artix Committed by antirez
Browse files

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

parent 3d5e2c62
...@@ -4887,7 +4887,7 @@ static int clusterManagerCommandRebalance(int argc, char **argv) { ...@@ -4887,7 +4887,7 @@ static int clusterManagerCommandRebalance(int argc, char **argv) {
listRewind(involved, &li); listRewind(involved, &li);
while ((ln = listNext(&li)) != NULL) { while ((ln = listNext(&li)) != NULL) {
clusterManagerNode *n = ln->value; clusterManagerNode *n = ln->value;
if (n->balance < 0 && total_balance > 0) { if (n->balance <= 0 && total_balance > 0) {
n->balance--; n->balance--;
total_balance--; total_balance--;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment