diff options
author | Blake Oler <blake.oler@mongodb.com> | 2020-04-01 13:56:21 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-04-06 14:56:03 +0000 |
commit | 2f5c276288eaf2f87522a708864f99952cd888a8 (patch) | |
tree | 14d77f1ceec323793324517f7df245c69f3337a6 /jstests/concurrency | |
parent | a5f2ec58c2360effcfeb338804bfa31dc4b7cff6 (diff) | |
download | mongo-2f5c276288eaf2f87522a708864f99952cd888a8.tar.gz |
SERVER-47011 Add list of errors to ignore in update shard key concurrency test (only in stepdown suites)
Diffstat (limited to 'jstests/concurrency')
-rw-r--r-- | jstests/concurrency/fsm_workloads/random_moveChunk_update_shard_key.js | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/jstests/concurrency/fsm_workloads/random_moveChunk_update_shard_key.js b/jstests/concurrency/fsm_workloads/random_moveChunk_update_shard_key.js index b565e66963a..30d33f6f188 100644 --- a/jstests/concurrency/fsm_workloads/random_moveChunk_update_shard_key.js +++ b/jstests/concurrency/fsm_workloads/random_moveChunk_update_shard_key.js @@ -33,6 +33,9 @@ var $config = extendWorkload($config, function($config, $super) { err.message.indexOf("Documents in target range may still be in use")); }; + $config.data.runningWithStepdowns = + TestData.runningWithConfigStepdowns || TestData.runningWithShardStepdowns; + // These errors below may arrive due to expected scenarios that occur with concurrent // migrations and shard key updates. These include transient transaction errors (targeting // issues, lock timeouts, etc) and duplicate key errors that are triggered during normal @@ -42,7 +45,8 @@ var $config = extendWorkload($config, function($config, $super) { // unrecoverable state. If an update fails in one of the above-described scenarios, we assert // that the document remains in the pre-updated state. After doing so, we may continue the // concurrency test. - $config.data.isUpdateShardKeyErrorAcceptable = (errCode, errMsg, errorLabels) => { + $config.data.isUpdateShardKeyErrorAcceptable = function isUpdateShardKeyAcceptable( + errCode, errMsg, errorLabels) { if (!errMsg) { return false; } @@ -63,7 +67,7 @@ var $config = extendWorkload($config, function($config, $super) { // Some return paths will strip out the TransientTransactionError label. We want to still // filter out those errors. - const transientTransactionErrors = [ + let skippableErrors = [ ErrorCodes.StaleConfig, ErrorCodes.WriteConflict, ErrorCodes.LockTimeout, @@ -71,9 +75,20 @@ var $config = extendWorkload($config, function($config, $super) { 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 transientTransactionErrors.includes(errCode); + return skippableErrors.includes(errCode); } return false; |