diff --git a/jstests/sharding/libs/resharding_test_fixture.js b/jstests/sharding/libs/resharding_test_fixture.js
|
index d445b42fdf..396f06c1c7 100644
|
--- a/jstests/sharding/libs/resharding_test_fixture.js
|
+++ b/jstests/sharding/libs/resharding_test_fixture.js
|
@@ -151,11 +151,10 @@ var ReshardingTest = class {
|
|
this._tempNs = `${sourceDB.getName()}.system.resharding.${sourceCollectionUUIDString}`;
|
|
- // mongos won't know about the temporary resharding collection and will therefore assume the
|
- // collection is unsharded. We configure one of the recipient shards to be the primary shard
|
- // for the database so mongos still ends up routing operations to a shard which owns the
|
- // temporary resharding collection.
|
- this._st.ensurePrimaryShard(sourceDB.getName(), this.recipientShardNames[0]);
|
+ // XXX: Force one of the non-recipient shards be the primary shard for the database to
|
+ // demonstrate the issue. resharding_allowMigrations.js doesn't attempt to read from the
|
+ // temporary resharding collection within the duringReshardingFn() callback anyway.
|
+ this._st.ensurePrimaryShard(sourceDB.getName(), this.donorShardNames[0]);
|
|
return sourceCollection;
|
}
|
diff --git a/jstests/sharding/resharding_allowMigrations.js b/jstests/sharding/resharding_allowMigrations.js
|
index c61a946cc4..06da3a5bff 100644
|
--- a/jstests/sharding/resharding_allowMigrations.js
|
+++ b/jstests/sharding/resharding_allowMigrations.js
|
@@ -22,6 +22,9 @@ const sourceCollection = reshardingTest.createShardedCollection({
|
chunks: [{min: {oldKey: MinKey}, max: {oldKey: MaxKey}, shard: donorShardNames[0]}],
|
});
|
|
+const originalCollInfo = sourceCollection.exists();
|
+assert.neq(originalCollInfo, null, "failed to find sharded collection before resharding");
|
+
|
const recipientShardNames = reshardingTest.recipientShardNames;
|
reshardingTest.withReshardingInBackground(
|
{
|
@@ -46,5 +49,9 @@ reshardingTest.withReshardingInBackground(
|
ErrorCodes.ConflictingOperationInProgress);
|
});
|
|
+const newCollInfo = sourceCollection.exists();
|
+assert.neq(newCollInfo, null, "failed to find sharded collection after resharding");
|
+assert.neq(newCollInfo.info.uuid, originalCollInfo.info.uuid, {newCollInfo, originalCollInfo});
|
+
|
reshardingTest.teardown();
|
})();
|