summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Polato <paolo.polato@mongodb.com>2022-09-30 12:00:00 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-09-30 12:33:27 +0000
commit5b1663a2e449ec0f563e0f9a7f80c0fddb709596 (patch)
tree14ca9c5522bbf550a6d79a80f6a05c0b4e832b30
parent926591a3d5657eb271b275e6fd49db663b325227 (diff)
downloadmongo-5b1663a2e449ec0f563e0f9a7f80c0fddb709596.tar.gz
SERVER-70128 Make drop_database_sharded_setFCV.js resilient to ErrorCodes::Interrupted
-rw-r--r--jstests/concurrency/fsm_workloads/drop_database_sharded_setFCV.js23
1 files changed, 23 insertions, 0 deletions
diff --git a/jstests/concurrency/fsm_workloads/drop_database_sharded_setFCV.js b/jstests/concurrency/fsm_workloads/drop_database_sharded_setFCV.js
index 132b9cda167..0d1d2bc1763 100644
--- a/jstests/concurrency/fsm_workloads/drop_database_sharded_setFCV.js
+++ b/jstests/concurrency/fsm_workloads/drop_database_sharded_setFCV.js
@@ -33,6 +33,29 @@ var $config = extendWorkload($config, function($config, $super) {
jsTestLog('setFCV state finished');
};
+ // Inherithed methods get overridden to tolerate the interruption of
+ // internal transactions on the config server during the execution of setFCV
+ // TODO SERVER-70131: remove the overrides if internal transactions are no longer interrupted.
+ $config.states.enableSharding = function(db, collName) {
+ try {
+ $super.states.enableSharding.apply(this, arguments);
+ } catch (err) {
+ if (err.code !== ErrorCodes.Interrupted) {
+ throw err;
+ }
+ }
+ };
+
+ $config.states.shardCollection = function(db, collName) {
+ try {
+ $super.states.shardCollection.apply(this, arguments);
+ } catch (err) {
+ if (err.code !== ErrorCodes.Interrupted) {
+ throw err;
+ }
+ }
+ };
+
$config.transitions = {
init: {enableSharding: 0.3, dropDatabase: 0.3, shardCollection: 0.3, setFCV: 0.1},
enableSharding: {enableSharding: 0.3, dropDatabase: 0.3, shardCollection: 0.3, setFCV: 0.1},