diff options
author | Alberto Lerner <alerner@10gen.com> | 2010-09-21 10:43:28 -0400 |
---|---|---|
committer | Alberto Lerner <alerner@10gen.com> | 2010-09-21 10:43:28 -0400 |
commit | 68df06feab125fd92f0853eb052ea86599b75bff (patch) | |
tree | 7ae937b1888d9ea1db8056c0c8c4bbbf0b6627e5 /dbtests | |
parent | a3986b4040198fab9253791bb45a514f0ee283cc (diff) | |
download | mongo-68df06feab125fd92f0853eb052ea86599b75bff.tar.gz |
SERVER-1713 if a shard has writebacks pending don't use it as a receiver
Diffstat (limited to 'dbtests')
-rw-r--r-- | dbtests/balancer_policy_tests.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/dbtests/balancer_policy_tests.cpp b/dbtests/balancer_policy_tests.cpp index 6421c10a56e..0836cec0bcb 100644 --- a/dbtests/balancer_policy_tests.cpp +++ b/dbtests/balancer_policy_tests.cpp @@ -74,8 +74,8 @@ namespace BalancerPolicyTests { // no limits BalancerPolicy::ShardToLimitsMap limitsMap; - BSONObj limits0 = BSON( sf::maxSize(0LL) << lf::currSize(2LL) << sf::draining(false) ); - BSONObj limits1 = BSON( sf::maxSize(0LL) << lf::currSize(0LL) << sf::draining(false) ); + BSONObj limits0 = BSON( sf::maxSize(0LL) << lf::currSize(2LL) << sf::draining(false) << lf::hasOpsQueued(false) ); + BSONObj limits1 = BSON( sf::maxSize(0LL) << lf::currSize(0LL) << sf::draining(false) << lf::hasOpsQueued(false) ); limitsMap["shard0"] = limits0; limitsMap["shard1"] = limits1; @@ -158,12 +158,14 @@ namespace BalancerPolicyTests { "max" << BSON( "x" << BSON( "$maxkey"<<1 )))); chunkMap["shard1"] = chunks; - // shard0 is draining, shard1 is maxed out + // shard0 is draining, shard1 is maxed out, shard2 has writebacks pending BalancerPolicy::ShardToLimitsMap limitsMap; BSONObj limits0 = BSON( sf::maxSize(0LL) << lf::currSize(2LL) << sf::draining(true) ); BSONObj limits1 = BSON( sf::maxSize(1LL) << lf::currSize(1LL) << sf::draining(false) ); + BSONObj limits2 = BSON( sf::maxSize(0LL) << lf::currSize(1LL) << lf::hasOpsQueued(true) ); limitsMap["shard0"] = limits0; limitsMap["shard1"] = limits1; + limitsMap["shard2"] = limits2; BalancerPolicy::ChunkInfo* c = NULL; c = BalancerPolicy::balance( "ns", limitsMap, chunkMap, 0 ); |