summaryrefslogtreecommitdiff
path: root/jstests/sharding/rename.js
diff options
context:
space:
mode:
authorPierlauro Sciarelli <pierlauro.sciarelli@mongodb.com>2021-05-18 08:55:52 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-05-18 11:02:42 +0000
commit3ce2c1f02f4961c024ec52f1a9f27fd6263a5aac (patch)
treef66fd614bb6611a0f5375c7fe7b035664208eda6 /jstests/sharding/rename.js
parent593376ad56a8f759faf7f8ad743cbbff5dbf1cf1 (diff)
downloadmongo-3ce2c1f02f4961c024ec52f1a9f27fd6263a5aac.tar.gz
SERVER-57021 Release locks before DB refresh in rename coordinator
Diffstat (limited to 'jstests/sharding/rename.js')
-rw-r--r--jstests/sharding/rename.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/jstests/sharding/rename.js b/jstests/sharding/rename.js
index c65ce8ca186..45a6f8ab071 100644
--- a/jstests/sharding/rename.js
+++ b/jstests/sharding/rename.js
@@ -60,7 +60,10 @@ assert.commandFailedWithCode(
"Source and destination collections must be on the same database.");
// Renaming unsharded collection to a different db with same primary shard.
-assert.commandWorked(db.unSharded.renameCollection('otherDBSamePrimary.unsharded'));
+assert.commandWorked(
+ db.adminCommand({renameCollection: 'test.unSharded', to: 'otherDBSamePrimary.foo'}));
+assert.eq(0, db.unsharded.countDocuments({}));
+assert.eq(1, s.getDB('otherDBSamePrimary').foo.countDocuments({}));
jsTest.log("Testing that rename operations involving views are not allowed");
{