diff options
Diffstat (limited to 'jstests/sharding/auth.js')
| -rw-r--r-- | jstests/sharding/auth.js | 30 |
1 files changed, 11 insertions, 19 deletions
diff --git a/jstests/sharding/auth.js b/jstests/sharding/auth.js index 3bf15b56716..48351d0a59b 100644 --- a/jstests/sharding/auth.js +++ b/jstests/sharding/auth.js @@ -10,7 +10,6 @@ 'use strict'; load("jstests/replsets/rslib.js"); load("jstests/sharding/libs/find_chunks_util.js"); -load("jstests/libs/feature_flag_util.js"); // Replica set nodes started with --shardsvr do not enable key generation until they are added // to a sharded cluster and reject commands with gossiped clusterTime from users without the @@ -175,32 +174,25 @@ awaitRSClientHosts(s.s, d2.nodes, {ok: true}); s.getDB("test").foo.remove({}); -var num = 10; +var num = 10000; assert.commandWorked(s.s.adminCommand({split: "test.foo", middle: {x: num / 2}})); -const bigString = 'X'.repeat(1024 * 1024); // 1MB var bulk = s.getDB("test").foo.initializeUnorderedBulkOp(); for (i = 0; i < num; i++) { - bulk.insert({_id: i, x: i, abc: "defg", date: new Date(), str: bigString}); + bulk.insert({_id: i, x: i, abc: "defg", date: new Date(), str: "all the talk on the market"}); } assert.commandWorked(bulk.execute()); s.startBalancer(60000); -const balanceAccordingToDataSize = - FeatureFlagUtil.isEnabled(s.getDB('admin'), "BalanceAccordingToDataSize"); -if (!balanceAccordingToDataSize) { - assert.soon(function() { - var d1Chunks = - findChunksUtil.countChunksForNs(s.getDB("config"), 'test.foo', {shard: "d1"}); - var d2Chunks = - findChunksUtil.countChunksForNs(s.getDB("config"), 'test.foo', {shard: "d2"}); - var totalChunks = findChunksUtil.countChunksForNs(s.getDB("config"), 'test.foo'); +assert.soon(function() { + var d1Chunks = findChunksUtil.countChunksForNs(s.getDB("config"), 'test.foo', {shard: "d1"}); + var d2Chunks = findChunksUtil.countChunksForNs(s.getDB("config"), 'test.foo', {shard: "d2"}); + var totalChunks = findChunksUtil.countChunksForNs(s.getDB("config"), 'test.foo'); - print("chunks: " + d1Chunks + " " + d2Chunks + " " + totalChunks); + print("chunks: " + d1Chunks + " " + d2Chunks + " " + totalChunks); - return d1Chunks > 0 && d2Chunks > 0 && (d1Chunks + d2Chunks == totalChunks); - }, "Chunks failed to balance", 60000, 5000); -} + return d1Chunks > 0 && d2Chunks > 0 && (d1Chunks + d2Chunks == totalChunks); +}, "Chunks failed to balance", 60000, 5000); // SERVER-33753: count() without predicate can be wrong on sharded collections. // assert.eq(s.getDB("test").foo.count(), num+1); @@ -242,7 +234,7 @@ if (numDocs != num) { // This call also waits for any ongoing balancing to stop s.stopBalancer(60000); -var cursor = s.getDB("test").foo.find({x: {$lt: 5}}); +var cursor = s.getDB("test").foo.find({x: {$lt: 500}}); var count = 0; while (cursor.hasNext()) { @@ -250,7 +242,7 @@ while (cursor.hasNext()) { count++; } -assert.eq(count, 5); +assert.eq(count, 500); logout(adminUser); |
