[SERVER-55879] Accommodate implicit collection creation in ReshardingTest's post-state assertions Created: 07/Apr/21  Updated: 29/Oct/23  Resolved: 23/Apr/21

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: 4.9.0-rc1, 5.0.0-rc0

Type: Task Priority: Major - P3
Reporter: Max Hirschhorn Assignee: Jamie Anderson
Resolution: Fixed Votes: 0
Labels: PM-234-M3
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Related
is related to SERVER-55781 Verify shard version matches before a... Closed
Backwards Compatibility: Fully Compatible
Sprint: Sharding 2021-05-03
Participants:
Linked BF Score: 133
Story Points: 1

 Description   

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`);



 Comments   
Comment by Githook User [ 26/Apr/21 ]

Author:

{'name': 'Jamie Anderson', 'email': 'jamie.anderson@mongodb.com', 'username': 'jandersongo'}

Message: SERVER-55879 Accommodate implicit collection creation in ReshardingTest's post-state assertions

(cherry picked from commit b0c83268977789b793a2b4bc385b6c47c56668c8)
Branch: v4.9
https://github.com/mongodb/mongo/commit/3f297279a73028f79419352ec1967d751f39e94b

Comment by Githook User [ 23/Apr/21 ]

Author:

{'name': 'Jamie Anderson', 'email': 'jamie.anderson@mongodb.com', 'username': 'jandersongo'}

Message: SERVER-55879 Accommodate implicit collection creation in ReshardingTest's post-state assertions
Branch: master
https://github.com/mongodb/mongo/commit/b0c83268977789b793a2b4bc385b6c47c56668c8

Generated at Thu Feb 08 05:37:43 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.