ReshardingTest#_checkDonorPostState() asserts that the donor shard has dropped the collection which was resharded by the time the reshardCollection command returns. However, as reported in SERVER-55781, index builds do not properly check the shard version and can lead to a collection with the same name being implicitly created on the donor shard with a different UUID.
The following assertion should be relaxed to say either (a) the collection doesn't exist (collInfo === null) or (b) the collection does exist but has a different UUID than before the resharding operation started (!bsonBinaryEqual(this._sourceCollectionUUID, collInfo.info.uuid)).
_checkDonorPostState(donor, expectedErrorCode) { const collInfo = donor.getCollection(this._ns).exists(); const isAlsoRecipient = this._recipientShards().includes(donor) || donor.shardName === this._primaryShardName; if (expectedErrorCode === ErrorCodes.OK && !isAlsoRecipient) { assert.eq( null, collInfo, `collection exists on ${donor.shardName} despite resharding having succeeded`);
- is related to
-
SERVER-55781 Verify shard version matches before allowing createIndexes in sharding opObserver
- Closed