We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 18737bc commit 8652841Copy full SHA for 8652841
s/balancer_policy.cpp
@@ -107,8 +107,11 @@ namespace mongo {
107
108
// Solving imbalances takes a higher priority than draining shards. Many shards can
109
// be draining at once but we choose only one of them to cater to per round.
110
+ // Important to start balanced, so when there are few chunks any imbalance must be fixed.
111
const int imbalance = max.second - min.second;
- const int threshold = balancedLastTime ? 2 : 8;
112
+ int threshold = 8;
113
+ if (balancedLastTime || max.second < 20) threshold = 2;
114
+ else if (max.second < 80) threshold = 4;
115
string from, to;
116
if ( imbalance >= threshold ) {
117
from = max.first;
0 commit comments