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

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

    • Fully Compatible
    • Sharding 2021-05-03
    • 133
    • 1

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

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

              Created:
              Updated:
              Resolved: