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

Ignore error from retryable write being converted to transaction and that transaction failing in random_moveChunk_update_shard_key.js

    XMLWordPrintable

Details

    • Fully Compatible
    • v5.1, v5.0, v4.4
    • Sharding 2021-11-15
    • 23
    • 1

    Description

      The $config.data.isUpdateShardKeyErrorAcceptable() function in the random_moveChunk_update_shard_key.js FSM workload is meant to swallow this error. However, it currently only ignores that error accompanied by a NoSuchTransaction code when running in the stepdown suites. We should move ErrorCodes.NoSuchTransaction into the skippableErrors array to reflect the server's new behavior.

      const otherErrorsInChangeShardKeyMsg = "was converted into a distributed transaction";
      ...
      // Some return paths will strip out the TransientTransactionError label. We want to still
      // filter out those errors.
      let skippableErrors = [
          ErrorCodes.StaleConfig,
          ErrorCodes.WriteConflict,
          ErrorCodes.LockTimeout,
          ErrorCodes.PreparedTransactionInProgress,
          ErrorCodes.ShardInvalidatedForTargeting
      ];
       
      // If we're running in a stepdown suite, then attempting to update the shard key may
      // interact with stepdowns and transactions to cause the following errors. We only expect
      // these errors in stepdown suites and not in other suites, so we surface them to the test
      // runner in other scenarios.
      const stepdownErrors =
          [ErrorCodes.NoSuchTransaction, ErrorCodes.ConflictingOperationInProgress];
       
      if (this.runningWithStepdowns) {
          skippableErrors.push(...stepdownErrors);
      }
       
      // Failed in the document shard key path, but not with a duplicate key error
      if (errMsg.includes(otherErrorsInChangeShardKeyMsg)) {
          return skippableErrors.includes(errCode);
      }
      

      Attachments

        Activity

          People

            luis.osta@mongodb.com Luis Osta (Inactive)
            max.hirschhorn@mongodb.com Max Hirschhorn
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: