diff options
author | mathisbessamdb <mathis.bessa@mongodb.com> | 2022-08-11 18:05:01 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-08-11 19:16:25 +0000 |
commit | f6f9f3232baa76150788e37713a1fbd946e99f5e (patch) | |
tree | e94040ee2d5b208726213d43431a0c6174d3c375 | |
parent | b6f2d94e35f0c6f4b00cd68077510f697f354122 (diff) | |
download | mongo-f6f9f3232baa76150788e37713a1fbd946e99f5e.tar.gz |
SERVER-68605 blacklist all the passthrough for shard merge
7 files changed, 52 insertions, 0 deletions
diff --git a/buildscripts/resmokeconfig/suites/tenant_migration_causally_consistent_jscore_passthrough.yml b/buildscripts/resmokeconfig/suites/tenant_migration_causally_consistent_jscore_passthrough.yml index 38ccc52b771..05b4d70b105 100644 --- a/buildscripts/resmokeconfig/suites/tenant_migration_causally_consistent_jscore_passthrough.yml +++ b/buildscripts/resmokeconfig/suites/tenant_migration_causally_consistent_jscore_passthrough.yml @@ -90,6 +90,8 @@ executor: keyFile: *keyFile keyFileData: *keyFileData roleGraphInvalidationIsFatal: true + # TODO SERVER-67860: remove the ignoreShardMergeFeatureFlag + ignoreShardMergeFeatureFlag: true # overrides the featureFlagShardMerge hooks: - class: ContinuousTenantMigration shell_options: diff --git a/buildscripts/resmokeconfig/suites/tenant_migration_jscore_passthrough.yml b/buildscripts/resmokeconfig/suites/tenant_migration_jscore_passthrough.yml index 49a93b9efd8..d8aca452100 100644 --- a/buildscripts/resmokeconfig/suites/tenant_migration_jscore_passthrough.yml +++ b/buildscripts/resmokeconfig/suites/tenant_migration_jscore_passthrough.yml @@ -61,6 +61,8 @@ executor: keyFile: *keyFile keyFileData: *keyFileData roleGraphInvalidationIsFatal: true + # TODO SERVER-66147: remove the ignoreShardMergeFeatureFlag + ignoreShardMergeFeatureFlag: true # overrides the featureFlagShardMerge hooks: - class: ContinuousTenantMigration shell_options: diff --git a/buildscripts/resmokeconfig/suites/tenant_migration_kill_primary_jscore_passthrough.yml b/buildscripts/resmokeconfig/suites/tenant_migration_kill_primary_jscore_passthrough.yml index 789152c0e84..69a701a8129 100644 --- a/buildscripts/resmokeconfig/suites/tenant_migration_kill_primary_jscore_passthrough.yml +++ b/buildscripts/resmokeconfig/suites/tenant_migration_kill_primary_jscore_passthrough.yml @@ -183,6 +183,8 @@ executor: readPreference: mode: "primary" retryWrites: true + # TODO SERVER-68643: remove the ignoreShardMergeFeatureFlag + ignoreShardMergeFeatureFlag: true # overrides the featureFlagShardMerge # We specify nodb so the shell used by each test will attempt to connect after loading the # retry logic in auto_retry_on_network_error.js. nodb: "" diff --git a/buildscripts/resmokeconfig/suites/tenant_migration_multi_stmt_txn_jscore_passthrough.yml b/buildscripts/resmokeconfig/suites/tenant_migration_multi_stmt_txn_jscore_passthrough.yml index c3c81736ea2..b4e1bc7969a 100644 --- a/buildscripts/resmokeconfig/suites/tenant_migration_multi_stmt_txn_jscore_passthrough.yml +++ b/buildscripts/resmokeconfig/suites/tenant_migration_multi_stmt_txn_jscore_passthrough.yml @@ -281,6 +281,8 @@ executor: # Tests in this suite only read from primaries and only one node is electable, so causal # consistency is not required to read your own writes. causalConsistency: false + # TODO SERVER-67860: remove the ignoreShardMergeFeatureFlag + ignoreShardMergeFeatureFlag: true # overrides the featureFlagShardMerge hooks: - class: ContinuousTenantMigration shell_options: diff --git a/buildscripts/resmokeconfig/suites/tenant_migration_stepdown_jscore_passthrough.yml b/buildscripts/resmokeconfig/suites/tenant_migration_stepdown_jscore_passthrough.yml index 9c0235d7df4..16ea2f7531a 100644 --- a/buildscripts/resmokeconfig/suites/tenant_migration_stepdown_jscore_passthrough.yml +++ b/buildscripts/resmokeconfig/suites/tenant_migration_stepdown_jscore_passthrough.yml @@ -173,6 +173,8 @@ executor: readPreference: mode: "primary" retryWrites: true + # TODO SERVER-68643: remove the ignoreShardMergeFeatureFlag + ignoreShardMergeFeatureFlag: true # overrides the featureFlagShardMerge # We specify nodb so the shell used by each test will attempt to connect after loading the # retry logic in auto_retry_on_network_error.js. nodb: "" diff --git a/buildscripts/resmokeconfig/suites/tenant_migration_terminate_primary_jscore_passthrough.yml b/buildscripts/resmokeconfig/suites/tenant_migration_terminate_primary_jscore_passthrough.yml index 729d1215b7f..979c118aff0 100644 --- a/buildscripts/resmokeconfig/suites/tenant_migration_terminate_primary_jscore_passthrough.yml +++ b/buildscripts/resmokeconfig/suites/tenant_migration_terminate_primary_jscore_passthrough.yml @@ -173,6 +173,8 @@ executor: readPreference: mode: "primary" retryWrites: true + # TODO SERVER-68643: remove the ignoreShardMergeFeatureFlag + ignoreShardMergeFeatureFlag: true # overrides the featureFlagShardMerge # We specify nodb so the shell used by each test will attempt to connect after loading the # retry logic in auto_retry_on_network_error.js. nodb: "" diff --git a/buildscripts/resmokelib/testing/hooks/tenant_migration.py b/buildscripts/resmokelib/testing/hooks/tenant_migration.py index 8d7c565919b..82bfef99d91 100644 --- a/buildscripts/resmokelib/testing/hooks/tenant_migration.py +++ b/buildscripts/resmokelib/testing/hooks/tenant_migration.py @@ -252,6 +252,7 @@ class _TenantMigrationThread(threading.Thread): # pylint: disable=too-many-inst self._test = None self._test_report = test_report self._shell_options = shell_options + self._use_shard_merge_protocol = False self.__lifecycle = TenantMigrationLifeCycle() # Event set when the thread has been stopped using the 'stop()' method. @@ -442,6 +443,38 @@ class _TenantMigrationThread(threading.Thread): # pylint: disable=too-many-inst migration_opts.migration_id, migration_opts.get_donor_name()) raise + def _is_shard_merge_enabled(self, primary_client): # noqa: D205,D400 + """Check if the shard merge feature flag is enabled. Returns true if both the shard merge + feature flag is set to true and that ignoreShardMergeFeatureFlag is set to false. + """ + shard_merge_feature_enabled = False + while True: + try: + shard_merge_flag_doc = primary_client.admin.command( + {"getParameter": 1, "featureFlagShardMerge": 1}) + fcv_doc = primary_client.admin.command( + {"getParameter": 1, "featureCompatibilityVersion": 1}) + flag_doc_is_shard_merge = shard_merge_flag_doc["featureFlagShardMerge"].get("value") + if not flag_doc_is_shard_merge: + return False + shard_merge_flag_version = shard_merge_flag_doc["featureFlagShardMerge"].get( + "version") + fcv_version = fcv_doc["featureCompatibilityVersion"].get("version") + shard_merge_feature_enabled = (float(fcv_version) >= + float(shard_merge_flag_version)) + break + except (pymongo.errors.AutoReconnect, pymongo.errors.NotMasterError): + self.logger.info("Retrying connection to primary for shard merge state doc check.") + continue + time.sleep(self.POLL_INTERVAL_SECS) + + if not shard_merge_feature_enabled: + return False + + ignore_shard_merge_feature_flag = self._shell_options["global_vars"]["TestData"].get( + "ignoreShardMergeFeatureFlag") + return not ignore_shard_merge_feature_flag + def _start_and_wait_for_migration(self, migration_opts): # noqa: D205,D400 """Run donorStartMigration to start a tenant migration based on 'migration_opts', wait for the migration decision and return the last response for donorStartMigration. @@ -463,6 +496,13 @@ class _TenantMigrationThread(threading.Thread): # pylint: disable=too-many-inst get_certificate_and_private_key("jstests/libs/tenant_migration_recipient.pem"), } donor_primary = migration_opts.get_donor_primary() + donor_primary_client = self._create_client(donor_primary) + is_shard_merge_enabled = self._is_shard_merge_enabled(donor_primary_client) + if is_shard_merge_enabled: + self._override_abort_failpoints(self._tenant_migration_fixture.common_mongod_options) + cmd_obj["protocol"] = "shard merge" + self._use_shard_merge_protocol = True + self.logger.info("Using shard merge protocol for tenant migration.") self.logger.info( "Starting tenant migration '%s' on donor primary on port %d of replica set '%s'.", |