mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-22 16:18:28 -05:00
Fix div by 0 in redis-cli cluster creation (#8553)
This could happen on an invalid use, when trying to create a cluster with a single node and provide it's address 3 time to satisfy redis-cli requirements.
This commit is contained in:
parent
17c226b070
commit
18ff8cd1fb
@ -2972,7 +2972,7 @@ static void clusterManagerOptimizeAntiAffinity(clusterManagerNodeArray *ipnodes,
|
|||||||
ip_count,
|
ip_count,
|
||||||
&offenders,
|
&offenders,
|
||||||
&offending_len);
|
&offending_len);
|
||||||
if (score == 0) break; // Optimal anti affinity reached
|
if (score == 0 || offending_len == 0) break; // Optimal anti affinity reached
|
||||||
/* We'll try to randomly swap a slave's assigned master causing
|
/* We'll try to randomly swap a slave's assigned master causing
|
||||||
* an affinity problem with another random slave, to see if we
|
* an affinity problem with another random slave, to see if we
|
||||||
* can improve the affinity. */
|
* can improve the affinity. */
|
||||||
|
Loading…
Reference in New Issue
Block a user