summaryrefslogtreecommitdiff
path: root/src/mongo/db/s/balancer
diff options
context:
space:
mode:
authorBilly Donahue <billy.donahue@mongodb.com>2018-11-06 16:20:39 -0500
committerBilly Donahue <billy.donahue@mongodb.com>2018-11-16 11:03:18 -0500
commit63e43f1bb47f7bddf3dc37ad03a2bbee6d2a9423 (patch)
tree80d0f30295208dd648b0edf3027fb508be291047 /src/mongo/db/s/balancer
parent1da5a8ac8ea43e1f704384238765fa5ca5b11af6 (diff)
downloadmongo-63e43f1bb47f7bddf3dc37ad03a2bbee6d2a9423.tar.gz
SERVER-5739 Fix races in RARELY/OCCASIONALLY.
Switch to using C++ instead of macros. Fix SERVER-37247: these should fire on first hit.
Diffstat (limited to 'src/mongo/db/s/balancer')
-rw-r--r--src/mongo/db/s/balancer/balancer.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mongo/db/s/balancer/balancer.cpp b/src/mongo/db/s/balancer/balancer.cpp
index f5570a52507..86a80ee5032 100644
--- a/src/mongo/db/s/balancer/balancer.cpp
+++ b/src/mongo/db/s/balancer/balancer.cpp
@@ -360,8 +360,10 @@ void Balancer::_mainThread() {
<< ", secondaryThrottle: "
<< balancerConfig->getSecondaryThrottle().toBSON();
- OCCASIONALLY warnOnMultiVersion(
- uassertStatusOK(_clusterStats->getStats(opCtx.get())));
+ static Occasionally sampler;
+ if (sampler.tick()) {
+ warnOnMultiVersion(uassertStatusOK(_clusterStats->getStats(opCtx.get())));
+ }
Status status = _enforceTagRanges(opCtx.get());
if (!status.isOK()) {