Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-55879

Accommodate implicit collection creation in ReshardingTest's post-state assertions

    XMLWordPrintable

    Details

    • Backwards Compatibility:
      Fully Compatible
    • Sprint:
      Sharding 2021-05-03
    • 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`);
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jamie.anderson Jamie Anderson
              Reporter:
              max.hirschhorn Max Hirschhorn
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: