diff options
author | Kyle Suarez <kyle.suarez@mongodb.com> | 2016-04-27 15:04:17 -0400 |
---|---|---|
committer | Kyle Suarez <kyle.suarez@mongodb.com> | 2016-04-27 15:04:17 -0400 |
commit | 21fa9ccd4e12d7a94a95d98e1e984ada2ef65548 (patch) | |
tree | ec935d3060da16ed7df0720a8e1aa818b993868f /jstests | |
parent | 99e48007ab663eb0cf1d7c1de2ad6c36374b705c (diff) | |
download | mongo-21fa9ccd4e12d7a94a95d98e1e984ada2ef65548.tar.gz |
Revert "SERVER-22667 Balancer chunk selection policy interface"
This reverts commit 2cf31060a74ac438b58c5150ba30da4144112744.
Diffstat (limited to 'jstests')
-rw-r--r-- | jstests/sharding/jumbo1.js | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/jstests/sharding/jumbo1.js b/jstests/sharding/jumbo1.js index 594c8165ab2..1e8a3a9fdb2 100644 --- a/jstests/sharding/jumbo1.js +++ b/jstests/sharding/jumbo1.js @@ -1,40 +1,39 @@ (function() { - 'use strict'; - var s = new ShardingTest({shards: 2, mongos: 1, other: {chunkSize: 1}}); + var s = new ShardingTest({name: "jumbo1", shards: 2, mongos: 1, other: {chunkSize: 1}}); - assert.commandWorked(s.s0.adminCommand({enablesharding: "test"})); + s.adminCommand({enablesharding: "test"}); s.ensurePrimaryShard('test', 'shard0001'); - assert.commandWorked(s.s0.adminCommand({shardcollection: "test.foo", key: {x: 1}})); + s.adminCommand({shardcollection: "test.foo", key: {x: 1}}); - var db = s.getDB("test"); + db = s.getDB("test"); - var big = ""; - while (big.length < 10000) { + big = ""; + while (big.length < 10000) big += "."; - } - var x = 0; + x = 0; var bulk = db.foo.initializeUnorderedBulkOp(); - for (; x < 500; x++) { + for (; x < 500; x++) bulk.insert({x: x, big: big}); - } - for (var i = 0; i < 500; i++) { + for (i = 0; i < 500; i++) bulk.insert({x: x, big: big}); - } - for (; x < 2000; x++) { + for (; x < 2000; x++) bulk.insert({x: x, big: big}); - } assert.writeOK(bulk.execute()); s.printShardingStatus(true); - assert.commandWorked(s.s0.adminCommand({moveChunk: 'test.foo', find: {x: 0}, to: 'shard0000'})); + + res = sh.moveChunk("test.foo", {x: 0}, "shard0001"); + if (!res.ok) + res = sh.moveChunk("test.foo", {x: 0}, "shard0000"); + s.printShardingStatus(true); - s.startBalancer(); + sh.setBalancerState(true); function diff1() { var x = s.chunkCounts("foo"); |