diff options
author | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2020-11-11 10:37:10 -0500 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-11-11 17:43:31 +0000 |
commit | ae52fb0d0ccdf33a626404fb1ac8a2ba4ea5d08b (patch) | |
tree | 7dbf139b7e7ad239b927b25581dff0a750322a86 /jstests/sharding/libs/track_unsharded_collections_helpers.js | |
parent | 90cfa3eeb18000ca3081e83be66ca4eaa244665e (diff) | |
download | mongo-ae52fb0d0ccdf33a626404fb1ac8a2ba4ea5d08b.tar.gz |
SERVER-51900 Get rid of the 'distributionMode' field of config.collections
Diffstat (limited to 'jstests/sharding/libs/track_unsharded_collections_helpers.js')
-rw-r--r-- | jstests/sharding/libs/track_unsharded_collections_helpers.js | 81 |
1 files changed, 0 insertions, 81 deletions
diff --git a/jstests/sharding/libs/track_unsharded_collections_helpers.js b/jstests/sharding/libs/track_unsharded_collections_helpers.js deleted file mode 100644 index 739118f9c0b..00000000000 --- a/jstests/sharding/libs/track_unsharded_collections_helpers.js +++ /dev/null @@ -1,81 +0,0 @@ -/** - * Common helpers for testing operations on unsharded collections. - */ - -function getNewNs(dbName) { - if (typeof getNewNs.counter == 'undefined') { - getNewNs.counter = 0; - } - getNewNs.counter++; - const collName = "ns" + getNewNs.counter; - return [collName, dbName + "." + collName]; -} - -function checkInStorageCatalog({dbName, collName, type, shardConn}) { - const query = {name: collName, type}; - assert.eq(1, - shardConn.getDB(dbName).getCollectionInfos(query).length, - "Current contents of storage catalog on " + shardConn + ": " + - tojson(shardConn.getDB(dbName).getCollectionInfos()) + - ", query: " + tojson(query)); -} - -function checkNotInStorageCatalog({dbName, collName, shardConn}) { - const query = {name: collName}; - assert.eq(0, - shardConn.getDB(dbName).getCollectionInfos(query).length, - "Current contents of storage catalog on " + shardConn + ": " + - tojson(shardConn.getDB(dbName).getCollectionInfos()) + - ", query: " + tojson(query)); -} - -function checkInShardingCatalog({ns, shardKey, unique, distributionMode, numChunks, mongosConn}) { - const configDB = mongosConn.getDB("config"); - - // Check the collection entry. - const collQuery = {}; - collQuery._id = ns; - collQuery["key." + shardKey] = 1; - collQuery.unique = unique; - collQuery.distributionMode = distributionMode; - assert.neq(null, - configDB.collections.findOne(collQuery), - "Current contents of config.collections: " + - tojson(configDB.collections.find().toArray()) + ", query: " + tojson(collQuery)); - - // Check the chunk entries. - const chunkQuery = {}; - chunkQuery.ns = ns; - chunkQuery["min." + shardKey] = {$exists: true}; - chunkQuery["max." + shardKey] = {$exists: true}; - assert.eq(numChunks, - configDB.chunks.count(chunkQuery), - "Current contents of config.chunks: " + tojson(configDB.chunks.find().toArray()) + - ", query: " + tojson(chunkQuery)); -} - -function checkNotInShardingCatalog({ns, mongosConn}) { - const configDB = mongosConn.getDB("config"); - - assert.eq( - null, - configDB.collections.findOne({_id: ns}), - "Current contents of config.collections: " + tojson(configDB.collections.find().toArray())); - assert.eq(0, - configDB.chunks.count({ns: ns}), - "Current contents of config.chunks: " + tojson(configDB.chunks.find().toArray())); -} - -function setFailpoint(failpointName, conn) { - assert.commandWorked(conn.adminCommand({ - configureFailPoint: failpointName, - mode: "alwaysOn", - })); -} - -function unsetFailpoint(failpointName, conn) { - assert.commandWorked(conn.adminCommand({ - configureFailPoint: failpointName, - mode: "off", - })); -} |