summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSophia Tan <sophia_tll@hotmail.com>2022-03-17 18:56:58 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-03-17 21:23:16 +0000
commita585eeb9a28570a32067aa98a460ee675d735a7b (patch)
tree83f736d3a6dd57ed963ffc1c870bcedd07f3a1e3
parent49d6e94c2363f27bda8cf4838635b443485d1bd9 (diff)
downloadmongo-a585eeb9a28570a32067aa98a460ee675d735a7b.tar.gz
SERVER-64064 Create jscore passthrough suite that talks directly to shardsvrs
-rw-r--r--buildscripts/resmokeconfig/suites/talk_directly_to_shardsvrs_jscore_passthrough.yml77
-rw-r--r--buildscripts/resmokelib/testing/fixtures/talk_directly_to_shardsvrs.py215
-rw-r--r--etc/evergreen.yml8
-rw-r--r--jstests/core/agg_hint.js2
-rw-r--r--jstests/core/cleanup_orphaned.js6
-rw-r--r--jstests/core/internal_rename_if_options_and_indexes_match.js3
-rw-r--r--jstests/core/list_databases.js3
-rw-r--r--jstests/core/opcounters_active.js2
-rw-r--r--jstests/core/startup_log.js8
-rw-r--r--jstests/core/timeseries/nondefault_collation.js6
-rw-r--r--jstests/core/timeseries/timeseries_find.js2
-rw-r--r--jstests/core/timeseries/timeseries_geonear_measurements.js2
-rw-r--r--jstests/core/timeseries/timeseries_id_range.js2
-rw-r--r--jstests/core/timeseries/timeseries_index_partial.js2
-rw-r--r--jstests/core/timeseries/timeseries_index_use.js2
-rw-r--r--jstests/core/timeseries/timeseries_internal_bounded_sort.js2
-rw-r--r--jstests/core/timeseries/timeseries_internal_bucket_geo_within.js2
-rw-r--r--jstests/core/timeseries/timeseries_lastpoint.js4
-rw-r--r--jstests/core/timeseries/timeseries_metric_index_2dsphere.js2
-rw-r--r--jstests/core/txns/banned_txn_dbs_unsharded.js10
-rw-r--r--jstests/core/txns/finished_transaction_error_handling.js9
-rw-r--r--jstests/core/txns/multi_statement_transaction_command_args.js9
-rw-r--r--jstests/core/txns/new_transaction_waits_for_previous_txn_table_updates.js8
-rw-r--r--jstests/core/txns/speculative_snapshot_includes_all_writes.js8
-rw-r--r--jstests/core/txns/timestamped_reads_wait_for_prepare_oplog_visibility.js8
-rw-r--r--jstests/core/views/views_aggregation.js2
-rw-r--r--jstests/core/views/views_collation.js2
-rw-r--r--jstests/core/views/views_count.js2
-rw-r--r--jstests/core/views/views_distinct.js2
-rw-r--r--jstests/core/views/views_find.js2
30 files changed, 398 insertions, 14 deletions
diff --git a/buildscripts/resmokeconfig/suites/talk_directly_to_shardsvrs_jscore_passthrough.yml b/buildscripts/resmokeconfig/suites/talk_directly_to_shardsvrs_jscore_passthrough.yml
new file mode 100644
index 00000000000..55797e90bbb
--- /dev/null
+++ b/buildscripts/resmokeconfig/suites/talk_directly_to_shardsvrs_jscore_passthrough.yml
@@ -0,0 +1,77 @@
+test_kind: js_test
+
+selector:
+ roots:
+ - jstests/core/**/*.js
+ exclude_files:
+ # These tests run applyOps which is not supported in serverless.
+ - jstests/core/apply_ops1.js
+ - jstests/core/apply_ops1.js
+ - jstests/core/apply_ops2.js
+ - jstests/core/apply_ops_dups.js
+ - jstests/core/apply_ops_index_collation.js
+ - jstests/core/apply_ops_invalid_index_spec.js
+ - jstests/core/apply_ops_missing_field.js
+ - jstests/core/apply_ops_system_dot_views.js
+ - jstests/core/apply_ops_without_ns.js
+ - jstests/core/bypass_doc_validation.js
+ - jstests/core/collmod_without_uuid.js
+ - jstests/core/txns/commands_banning_txnnumber_outside_transactions.js
+ - jstests/core/txns/commands_not_allowed_in_txn.js
+ - jstests/core/txns/prepare_transaction_fails_on_temp_collections.js
+ - jstests/core/txns/statement_ids_accepted.js
+ - jstests/core/list_collections1.js
+ - jstests/core/list_collections_filter.js
+ - jstests/core/list_collections_no_views.js
+ - jstests/core/views/view_with_invalid_dbname.js
+ - jstests/core/views/views_creation.js
+ - jstests/core/views/invalid_system_views.js
+ - jstests/core/views/views_all_commands.js
+ - jstests/core/rename_collection_staytemp.js
+ # This test expects that the connection (i.e. 'threadName') does not change throughout each test
+ # case. That is not always true when the test driver use a replica set connection string. As this
+ # test sets fail point with error code NotWritablePrimary, the test driver changes its topology to
+ # ReplicaSetNoPrimary and create a new connection once it get the primary again.
+ - jstests/core/failcommand_failpoint.js
+
+ exclude_with_any_tags:
+ - assumes_standalone_mongod
+ - command_not_supported_in_serverless
+ # capped collections are banned in Serverless.
+ - requires_capped
+ # In this suite the test talks directly to shardsvrs (doesn't go through mongos).
+ - directly_against_shardsvrs_incompatible
+ # TODO (SERVER-64132): Remove these tests from the exclude list. They may currently fail because
+ # they create a collection via the renameCollection path, so are not created with kUnsharded
+ # filtering metadata.
+ - uses_$out
+ - uses_map_reduce_with_temp_collections
+
+executor:
+ archive:
+ tests: true
+ hooks:
+ - CheckReplDBHash
+ - CheckReplOplogs
+ - ValidateCollections
+ config:
+ shell_options:
+ eval: >-
+ testingReplication = true;
+ hooks:
+ # The CheckReplDBHash hook waits until all operations have replicated to and have been applied
+ # on the secondaries, so we run the ValidateCollections hook after it to ensure we're
+ # validating the entire contents of the collection.
+ - class: CheckReplOplogs
+ - class: CheckReplDBHash
+ - class: ValidateCollections
+ - class: CleanEveryN
+ n: 20
+ fixture:
+ class: TalkDirectlyToShardsvrsFixture
+ common_mongod_options:
+ set_parameters:
+ enableTestCommands: 1
+ num_replica_sets: 1
+ num_nodes_per_replica_set: 3
+ use_replica_set_connection_string: true
diff --git a/buildscripts/resmokelib/testing/fixtures/talk_directly_to_shardsvrs.py b/buildscripts/resmokelib/testing/fixtures/talk_directly_to_shardsvrs.py
new file mode 100644
index 00000000000..8dcdc475b98
--- /dev/null
+++ b/buildscripts/resmokelib/testing/fixtures/talk_directly_to_shardsvrs.py
@@ -0,0 +1,215 @@
+"""Fixture with shardsvrs without mongos/mongoq for executing JSTests against."""
+
+import os.path
+
+import pymongo
+import pymongo.write_concern
+
+import buildscripts.resmokelib.testing.fixtures.interface as interface
+from buildscripts.resmokelib.testing.fixtures.fixturelib import FixtureLib
+
+
+class TalkDirectlyToShardsvrsFixture(interface.MultiClusterFixture): # pylint: disable=too-many-instance-attributes
+ """Fixture which provides JSTests with a set of shardsvrs and a config svr set to run against."""
+
+ def __init__( # pylint: disable=too-many-arguments,too-many-locals
+ self, logger, job_num, fixturelib, common_mongod_options=None, dbpath_prefix=None,
+ preserve_dbpath=False, num_replica_sets=1, num_nodes_per_replica_set=3,
+ start_initial_sync_node=False, write_concern_majority_journal_default=None,
+ auth_options=None, replset_config_options=None, voting_secondaries=True,
+ all_nodes_electable=False, use_replica_set_connection_string=None, linear_chain=False,
+ mixed_bin_versions=None, default_read_concern=None, default_write_concern=None):
+ """Initialize TalkDirectlyToShardsvrsFixture with different options for the replica set processes."""
+
+ interface.MultiClusterFixture.__init__(self, logger, job_num, fixturelib,
+ dbpath_prefix=dbpath_prefix)
+
+ self.common_mongod_options = self.fixturelib.default_if_none(common_mongod_options, {})
+ self.preserve_dbpath = preserve_dbpath
+ self.start_initial_sync_node = start_initial_sync_node
+ self.write_concern_majority_journal_default = write_concern_majority_journal_default
+ self.auth_options = auth_options
+ self.replset_config_options = self.fixturelib.default_if_none(replset_config_options, {})
+ self.voting_secondaries = voting_secondaries
+ self.all_nodes_electable = all_nodes_electable
+ self.use_replica_set_connection_string = use_replica_set_connection_string
+ self.default_read_concern = default_read_concern
+ self.default_write_concern = default_write_concern
+ self.mixed_bin_versions = self.fixturelib.default_if_none(mixed_bin_versions,
+ self.config.MIXED_BIN_VERSIONS)
+ self.mixed_bin_versions_config = self.mixed_bin_versions
+
+ # Use the values given from the command line if they exist for linear_chain and num_nodes.
+ linear_chain_option = self.fixturelib.default_if_none(self.config.LINEAR_CHAIN,
+ linear_chain)
+ self.linear_chain = linear_chain_option if linear_chain_option else linear_chain
+ self.num_nodes_per_replica_set = num_nodes_per_replica_set if num_nodes_per_replica_set \
+ else self.config.NUM_REPLSET_NODES
+ self.num_replica_sets = num_replica_sets if num_replica_sets else self.config.NUM_REPLSETS
+
+ if self.num_replica_sets != 1:
+ raise ValueError("num_replica_sets must be equal to 1")
+
+ self.configsvr = None
+ # Store the replica sets in an array because in the future we may want to use this
+ # fixture with more than one replica set.
+ self.replica_sets = []
+
+ if not self.configsvr:
+ rs_name = "config"
+
+ replset_config_options = self.replset_config_options.copy()
+ replset_config_options["configsvr"] = True
+
+ mongod_options = self.common_mongod_options.copy()
+ mongod_options["configsvr"] = ""
+ mongod_options["dbpath"] = os.path.join(self._dbpath_prefix, rs_name)
+ mongod_options["replSet"] = rs_name
+ mongod_options["storageEngine"] = "wiredTiger"
+
+ self.configsvr = self.fixturelib.make_fixture(
+ "ReplicaSetFixture", self.logger, self.job_num, mongod_options=mongod_options,
+ preserve_dbpath=self.preserve_dbpath, num_nodes=self.num_nodes_per_replica_set,
+ auth_options=self.auth_options, replset_config_options=replset_config_options,
+ mixed_bin_versions=self.mixed_bin_versions, replicaset_logging_prefix=rs_name,
+ use_replica_set_connection_string=self.use_replica_set_connection_string,
+ all_nodes_electable=self.all_nodes_electable)
+
+ if not self.replica_sets:
+ for i in range(self.num_replica_sets):
+ rs_name = f"rs{i}"
+ mongod_options = self.common_mongod_options.copy()
+ mongod_options["shardsvr"] = ""
+ mongod_options["dbpath"] = os.path.join(self._dbpath_prefix, rs_name)
+ mongod_options["replSet"] = rs_name
+
+ self.replica_sets.append(
+ self.fixturelib.make_fixture(
+ "ReplicaSetFixture", self.logger, self.job_num,
+ mongod_options=mongod_options, preserve_dbpath=self.preserve_dbpath,
+ num_nodes=self.num_nodes_per_replica_set, auth_options=self.auth_options,
+ replset_config_options=self.replset_config_options,
+ mixed_bin_versions=self.mixed_bin_versions,
+ replicaset_logging_prefix=rs_name,
+ use_replica_set_connection_string=self.use_replica_set_connection_string,
+ all_nodes_electable=self.all_nodes_electable, replset_name=rs_name))
+
+ def pids(self):
+ """:return: pids owned by this fixture if any."""
+ out = []
+ for replica_set in self.replica_sets:
+ out.extend(replica_set.pids())
+ if not out:
+ self.logger.debug('No replica sets when gathering multi replicaset fixture pids.')
+ return out
+
+ def setup(self):
+ """Set up the fixture."""
+ #Set up the config server replica set.
+ self.configsvr.setup()
+ #Set up the replica sets.
+ for replica_set in self.replica_sets:
+ replica_set.setup()
+
+ def refresh_logical_session_cache(self, target):
+ """Refresh logical session cache with no timeout."""
+ primary = target.get_primary().mongo_client()
+ try:
+ primary.admin.command({"refreshLogicalSessionCacheNow": 1})
+ except pymongo.errors.OperationFailure as err:
+ if err.code != self._WRITE_CONCERN_FAILED:
+ raise err
+ self.logger.info("Ignoring write concern timeout for refreshLogicalSessionCacheNow "
+ "command and continuing to wait")
+ target.await_last_op_committed(target.AWAIT_REPL_TIMEOUT_FOREVER_MINS * 60)
+
+ def await_ready(self):
+ """Block until the fixture can be used for testing."""
+ # Wait for the config server
+ self.configsvr.await_ready()
+
+ # Wait for each of the shards
+ for replica_set in self.replica_sets:
+ replica_set.await_ready()
+
+ # Add all the shards
+ for replica_set in self.replica_sets:
+ connection_string = replica_set.get_internal_connection_string()
+ self.logger.info("Adding %s as a shard...", connection_string)
+
+ config_primary = self.configsvr.get_primary()
+ config_primary_client = interface.authenticate(config_primary.mongo_client(),
+ self.auth_options)
+
+ try:
+ config_primary_client.admin.command(
+ {"_configsvrAddShard": connection_string},
+ write_concern=pymongo.write_concern.WriteConcern(w="majority"))
+ except:
+ self.logger.exception("Error calling addShard for replica set '%s'",
+ connection_string)
+ raise
+
+ # Ensure that the sessions collection gets auto-sharded by the config server
+ self.logger.info("Sending refresh logical session cache to configsvr")
+ self.refresh_logical_session_cache(self.configsvr)
+
+ for replica_set in self.replica_sets:
+ self.logger.info("Sending refresh logical session cache to shards")
+ self.refresh_logical_session_cache(replica_set)
+
+ def _do_teardown(self, mode=None):
+ """Shut down the replica sets."""
+ self.logger.info("Stopping all replica sets...")
+
+ running_at_start = self.is_running()
+ if not running_at_start:
+ self.logger.warning("All replica sets were expected to be running, but weren't.")
+
+ teardown_handler = interface.FixtureTeardownHandler(self.logger)
+
+ for replica_set in self.replica_sets:
+ teardown_handler.teardown(replica_set, "replica_set", mode=mode)
+
+ teardown_handler.teardown(self.configsvr, "config server", mode=mode)
+
+ if teardown_handler.was_successful():
+ self.logger.info("Successfully stopped all replica sets.")
+ else:
+ self.logger.error("Stopping the fixture failed.")
+ raise self.fixturelib.ServerFailure(teardown_handler.get_error_message())
+
+ def is_running(self):
+ """Return true if all replica sets are still operating."""
+ return all(replica_set.is_running() for replica_set in self.replica_sets)
+
+ def get_num_replsets(self):
+ """Return the number of replica sets."""
+ return self.num_replica_sets
+
+ def get_replset(self, index):
+ """Return the ReplicaSetFixture for the replica set at the given index."""
+ return self.replica_sets[index]
+
+ def get_replsets(self):
+ """Return the ReplicaSetFixtures for all the replica sets."""
+ return self.replica_sets
+
+ def get_internal_connection_string(self):
+ """Return the internal connection string to the replica set that currently starts out owning the data."""
+ return self.replica_sets[0].get_internal_connection_string()
+
+ def get_driver_connection_url(self):
+ """Return the driver connection URL to the replica set that currently starts out owning the data."""
+ return self.replica_sets[0].get_driver_connection_url()
+
+ def get_independent_clusters(self):
+ """Return the replica sets involved in the cluster."""
+ return self.replica_sets.copy()
+
+ def get_node_info(self):
+ """Return a list of dicts of NodeInfo objects."""
+ output = []
+ for replica_set in self.replica_sets:
+ output += replica_set.get_node_info()
+ return output
diff --git a/etc/evergreen.yml b/etc/evergreen.yml
index f7641adbac9..971b5dfd5aa 100644
--- a/etc/evergreen.yml
+++ b/etc/evergreen.yml
@@ -5097,6 +5097,14 @@ tasks:
use_large_distro: "true"
- <<: *gen_task_template
+ name: talk_directly_to_shardsvrs_jscore_passthrough_gen
+ tags: ["serverless"]
+ commands:
+ - func: "generate resmoke tasks"
+ vars:
+ use_large_distro: "true"
+
+- <<: *gen_task_template
name: tenant_migration_causally_consistent_jscore_passthrough_gen
tags: ["serverless"]
commands:
diff --git a/jstests/core/agg_hint.js b/jstests/core/agg_hint.js
index 0deb0bf4408..8bc2748e228 100644
--- a/jstests/core/agg_hint.js
+++ b/jstests/core/agg_hint.js
@@ -3,6 +3,8 @@
// @tags: [
// assumes_no_implicit_collection_creation_after_drop,
// does_not_support_stepdowns,
+// # Explain of a resolved view must be executed by mongos.
+// directly_against_shardsvrs_incompatible,
// ]
// Confirms correct behavior for hinted aggregation execution. This includes tests for scenarios
diff --git a/jstests/core/cleanup_orphaned.js b/jstests/core/cleanup_orphaned.js
index 344d603eb72..30e18601ea5 100644
--- a/jstests/core/cleanup_orphaned.js
+++ b/jstests/core/cleanup_orphaned.js
@@ -1,4 +1,8 @@
-// @tags: [requires_non_retryable_commands]
+// This test expects to be run against a non-shardsvr.
+// @tags: [
+// requires_non_retryable_commands,
+// directly_against_shardsvrs_incompatible,
+// ]
// Test that cleanupOrphaned cannot be run on stand alone mongod.
var res = db.adminCommand({cleanupOrphaned: 'unsharded.coll'});
diff --git a/jstests/core/internal_rename_if_options_and_indexes_match.js b/jstests/core/internal_rename_if_options_and_indexes_match.js
index 16645032d66..05bb9c0589d 100644
--- a/jstests/core/internal_rename_if_options_and_indexes_match.js
+++ b/jstests/core/internal_rename_if_options_and_indexes_match.js
@@ -1,11 +1,14 @@
// Test that internalRenameIfOptionsAndIndexesMatch command works as expected.
//
// This command cannot be run against mongos.
+// This test does not send dbVersion with internalRenameIfOptionsAndIndexeMatch, so cannot be run
+// directly against shardsvrs.
// @tags: [
// assumes_against_mongod_not_mongos,
// incompatible_with_embedded,
// requires_capped,
// requires_non_retryable_commands,
+// directly_against_shardsvrs_incompatible,
// ]
(function() {
diff --git a/jstests/core/list_databases.js b/jstests/core/list_databases.js
index 2a1db9fc5d1..93e2bf8273d 100644
--- a/jstests/core/list_databases.js
+++ b/jstests/core/list_databases.js
@@ -17,6 +17,9 @@ function verifySizeSum(listDatabasesOut) {
}
function verifyNameOnly(listDatabasesOut) {
+ // Delete extra meta info only returned by shardsvrs.
+ delete listDatabasesOut.lastCommittedOpTime;
+
for (let field in listDatabasesOut) {
assert(['databases', 'nameOnly', 'ok', 'operationTime', '$clusterTime'].some((f) => f ==
field),
diff --git a/jstests/core/opcounters_active.js b/jstests/core/opcounters_active.js
index 7df8c26b6c0..b19033272b0 100644
--- a/jstests/core/opcounters_active.js
+++ b/jstests/core/opcounters_active.js
@@ -30,4 +30,4 @@ assert.neq(0, result.metrics.commands.serverStatus.total, tojson(result));
// Test that the command returns successfully when no metrics tree is present
var result = db.serverStatus({"metrics": 0});
assert.eq(undefined, result.metrics, tojson(result));
-}()); \ No newline at end of file
+}());
diff --git a/jstests/core/startup_log.js b/jstests/core/startup_log.js
index 7fda5f35b87..f905e4a34e0 100644
--- a/jstests/core/startup_log.js
+++ b/jstests/core/startup_log.js
@@ -65,9 +65,11 @@ assert.eq(serverStatus.pid, latestStartUpLog.pid, "pid doesn't match that from s
// Test buildinfo
var buildinfo = db.runCommand("buildinfo");
-delete buildinfo.ok; // Delete extra meta info not in startup_log
-delete buildinfo.operationTime; // Delete extra meta info not in startup_log
-delete buildinfo.$clusterTime; // Delete extra meta info not in startup_log
+delete buildinfo.ok; // Delete extra meta info not in startup_log
+delete buildinfo.operationTime; // Delete extra meta info not in startup_log
+delete buildinfo.$clusterTime; // Delete extra meta info not in startup_log
+delete buildinfo.lastCommittedOpTime; // Delete extra meta info not in startup_log (only returned
+ // by shardsvrs)
var hello = db._adminCommand("hello");
// Test buildinfo has the expected keys
diff --git a/jstests/core/timeseries/nondefault_collation.js b/jstests/core/timeseries/nondefault_collation.js
index cb23ec6fd56..3ff1c63d330 100644
--- a/jstests/core/timeseries/nondefault_collation.js
+++ b/jstests/core/timeseries/nondefault_collation.js
@@ -8,7 +8,9 @@
* requires_getmore,
* does_not_support_stepdowns,
* does_not_support_transactions,
- * multiversion_incompatible
+ * multiversion_incompatible,
+ * # Explain of a resolved view must be executed by mongos.
+ * directly_against_shardsvrs_incompatible,
* ]
*/
(function() {
@@ -138,4 +140,4 @@ assert(aggPlanHasStage(defaultCollationQuery, "IXSCAN"), defaultCollationQuery);
// collation.
results = coll.find({value: {$gt: "4"}}, simpleCollation);
assert.eq(4, results.itcount());
-}()); \ No newline at end of file
+}());
diff --git a/jstests/core/timeseries/timeseries_find.js b/jstests/core/timeseries/timeseries_find.js
index 283b951bd9f..a6e8efa9aa3 100644
--- a/jstests/core/timeseries/timeseries_find.js
+++ b/jstests/core/timeseries/timeseries_find.js
@@ -8,6 +8,8 @@
* requires_timeseries,
* # Required because of deficiencies in the burnin multiversion system.
* requires_fcv_51,
+ * # Explain of a resolved view must be executed by mongos.
+ * directly_against_shardsvrs_incompatible,
* ]
*/
diff --git a/jstests/core/timeseries/timeseries_geonear_measurements.js b/jstests/core/timeseries/timeseries_geonear_measurements.js
index ddf2c8cf511..5c5427a02d1 100644
--- a/jstests/core/timeseries/timeseries_geonear_measurements.js
+++ b/jstests/core/timeseries/timeseries_geonear_measurements.js
@@ -15,6 +15,8 @@
* requires_fcv_51,
* requires_pipeline_optimization,
* requires_timeseries,
+ * # Explain of a resolved view must be executed by mongos.
+ * directly_against_shardsvrs_incompatible,
* ]
*/
diff --git a/jstests/core/timeseries/timeseries_id_range.js b/jstests/core/timeseries/timeseries_id_range.js
index 13ab73d62fc..46aa03f8230 100644
--- a/jstests/core/timeseries/timeseries_id_range.js
+++ b/jstests/core/timeseries/timeseries_id_range.js
@@ -9,6 +9,8 @@
* does_not_support_transactions,
* requires_getmore,
* requires_fcv_52,
+ * # Explain of a resolved view must be executed by mongos.
+ * directly_against_shardsvrs_incompatible,
* ]
*/
(function() {
diff --git a/jstests/core/timeseries/timeseries_index_partial.js b/jstests/core/timeseries/timeseries_index_partial.js
index eb1780feb12..eb2512b1bd7 100644
--- a/jstests/core/timeseries/timeseries_index_partial.js
+++ b/jstests/core/timeseries/timeseries_index_partial.js
@@ -5,6 +5,8 @@
* does_not_support_stepdowns,
* does_not_support_transactions,
* requires_fcv_52,
+ * # Explain of a resolved view must be executed by mongos.
+ * directly_against_shardsvrs_incompatible,
* ]
*/
(function() {
diff --git a/jstests/core/timeseries/timeseries_index_use.js b/jstests/core/timeseries/timeseries_index_use.js
index ce81183d476..8770047f4d2 100644
--- a/jstests/core/timeseries/timeseries_index_use.js
+++ b/jstests/core/timeseries/timeseries_index_use.js
@@ -7,6 +7,8 @@
* requires_fcv_51,
* requires_getmore,
* requires_pipeline_optimization,
+ * # Explain of a resolved view must be executed by mongos.
+ * directly_against_shardsvrs_incompatible,
* ]
*/
(function() {
diff --git a/jstests/core/timeseries/timeseries_internal_bounded_sort.js b/jstests/core/timeseries/timeseries_internal_bounded_sort.js
index f16ae458143..a158aa0bba3 100644
--- a/jstests/core/timeseries/timeseries_internal_bounded_sort.js
+++ b/jstests/core/timeseries/timeseries_internal_bounded_sort.js
@@ -8,6 +8,8 @@
* # Refusing to run a test that issues an aggregation command with explain because it may return
* # incomplete results if interrupted by a stepdown.
* does_not_support_stepdowns,
+ * # Explain of a resolved view must be executed by mongos.
+ * directly_against_shardsvrs_incompatible,
* ]
*/
(function() {
diff --git a/jstests/core/timeseries/timeseries_internal_bucket_geo_within.js b/jstests/core/timeseries/timeseries_internal_bucket_geo_within.js
index b4b7f083552..9c237d8dd77 100644
--- a/jstests/core/timeseries/timeseries_internal_bucket_geo_within.js
+++ b/jstests/core/timeseries/timeseries_internal_bucket_geo_within.js
@@ -9,6 +9,8 @@
* requires_timeseries,
* does_not_support_stepdowns,
* does_not_support_transactions,
+ * # Explain of a resolved view must be executed by mongos.
+ * directly_against_shardsvrs_incompatible,
* ]
*/
diff --git a/jstests/core/timeseries/timeseries_lastpoint.js b/jstests/core/timeseries/timeseries_lastpoint.js
index 05344c194da..f6c2575bfa5 100644
--- a/jstests/core/timeseries/timeseries_lastpoint.js
+++ b/jstests/core/timeseries/timeseries_lastpoint.js
@@ -8,7 +8,9 @@
* requires_pipeline_optimization,
* requires_fcv_53,
* # TODO (SERVER-63590): Investigate presence of getmore tag in timeseries jstests.
- * requires_getmore
+ * requires_getmore,
+ * # Explain of a resolved view must be executed by mongos.
+ * directly_against_shardsvrs_incompatible,
* ]
*/
(function() {
diff --git a/jstests/core/timeseries/timeseries_metric_index_2dsphere.js b/jstests/core/timeseries/timeseries_metric_index_2dsphere.js
index a7fece34c53..09ff02c8999 100644
--- a/jstests/core/timeseries/timeseries_metric_index_2dsphere.js
+++ b/jstests/core/timeseries/timeseries_metric_index_2dsphere.js
@@ -8,6 +8,8 @@
* does_not_support_transactions,
* requires_fcv_51,
* requires_getmore,
+ * # Explain of a resolved view must be executed by mongos.
+ * directly_against_shardsvrs_incompatible,
* ]
*/
diff --git a/jstests/core/txns/banned_txn_dbs_unsharded.js b/jstests/core/txns/banned_txn_dbs_unsharded.js
index 158067edbf3..e0109a4d01d 100644
--- a/jstests/core/txns/banned_txn_dbs_unsharded.js
+++ b/jstests/core/txns/banned_txn_dbs_unsharded.js
@@ -1,6 +1,14 @@
// Tests that reads and writes to the config and local databases are forbidden within
// transactions on non-sharded clusters. Behavior on sharded clusters is tested separately.
-// @tags: [assumes_against_mongod_not_mongos, assumes_unsharded_collection, uses_transactions]
+// @tags: [
+// assumes_against_mongod_not_mongos,
+// assumes_unsharded_collection,
+// uses_transactions,
+// # Transactions on config and local dbs are allowed on shardsvrs.
+// # TODO SERVER-64544: Investigate if we should ban transactions on config and local db's in
+// # serverless. If yes, we will remove this tag.
+// directly_against_shardsvrs_incompatible,
+// ]
(function() {
"use strict";
diff --git a/jstests/core/txns/finished_transaction_error_handling.js b/jstests/core/txns/finished_transaction_error_handling.js
index 2c22e606532..c8a72916754 100644
--- a/jstests/core/txns/finished_transaction_error_handling.js
+++ b/jstests/core/txns/finished_transaction_error_handling.js
@@ -1,5 +1,12 @@
// Test committed and aborted transactions cannot be changed but commitTransaction is retryable.
-// @tags: [uses_transactions, uses_snapshot_read_concern]
+// @tags: [
+// uses_transactions,
+// uses_snapshot_read_concern,
+// # Retrying an aborted transaction is allowed on shardsvrs.
+// # TODO SERVER-64484: Remove this tag as shardsvrs running in serverless mode will error on an
+// # attempt to retry an aborted transaction as mongods do when not running as a shardsvr.
+// directly_against_shardsvrs_incompatible,
+//]
(function() {
"use strict";
diff --git a/jstests/core/txns/multi_statement_transaction_command_args.js b/jstests/core/txns/multi_statement_transaction_command_args.js
index 15b7c4f759f..92ca6541524 100644
--- a/jstests/core/txns/multi_statement_transaction_command_args.js
+++ b/jstests/core/txns/multi_statement_transaction_command_args.js
@@ -1,7 +1,14 @@
/**
* Verify that multi-statement transaction command arguments behave correctly.
*
- * @tags: [uses_transactions, uses_snapshot_read_concern]
+ * @tags: [
+ * uses_transactions,
+ * uses_snapshot_read_concern,
+ * # Retrying an aborted transaction is allowed on shardsvrs.
+ * # TODO SERVER-64484: Remove this tag as shardsvrs running in serverless mode will error on an
+ * # attempt to retry an aborted transaction as mongods do when not running as a shardsvr.
+ * directly_against_shardsvrs_incompatible,
+ * ]
*/
(function() {
diff --git a/jstests/core/txns/new_transaction_waits_for_previous_txn_table_updates.js b/jstests/core/txns/new_transaction_waits_for_previous_txn_table_updates.js
index 0f4a710887e..e5f2bf8a1c4 100644
--- a/jstests/core/txns/new_transaction_waits_for_previous_txn_table_updates.js
+++ b/jstests/core/txns/new_transaction_waits_for_previous_txn_table_updates.js
@@ -16,7 +16,13 @@
* If we did not wait, the latter would get a write conflict when writing to the txn table because
* it's reading from time 7 and doesn't see the write from time 9.
*
- * @tags: [uses_transactions, uses_prepare_transaction, uses_parallel_shell]
+ * @tags: [
+ * uses_transactions,
+ * uses_prepare_transaction,
+ * uses_parallel_shell,
+ * # 'setDefaultRWConcern' is not supposed to be run on shard nodes.
+ * command_not_supported_in_serverless,
+ * ]
*/
(function() {
diff --git a/jstests/core/txns/speculative_snapshot_includes_all_writes.js b/jstests/core/txns/speculative_snapshot_includes_all_writes.js
index 7014ea3fa00..64b6bf9be35 100644
--- a/jstests/core/txns/speculative_snapshot_includes_all_writes.js
+++ b/jstests/core/txns/speculative_snapshot_includes_all_writes.js
@@ -1,7 +1,13 @@
/**
* A speculative snapshot must not include any writes ordered after any uncommitted writes.
*
- * @tags: [uses_transactions, requires_majority_read_concern, uses_parallel_shell]
+ * @tags: [
+ * uses_transactions,
+ * requires_majority_read_concern,
+ * uses_parallel_shell,
+ * # 'setDefaultRWConcern' is not supposed to be run on shard nodes.
+ * command_not_supported_in_serverless,
+ * ]
*/
(function() {
"use strict";
diff --git a/jstests/core/txns/timestamped_reads_wait_for_prepare_oplog_visibility.js b/jstests/core/txns/timestamped_reads_wait_for_prepare_oplog_visibility.js
index c44733a8cb2..fdba5e44e8b 100644
--- a/jstests/core/txns/timestamped_reads_wait_for_prepare_oplog_visibility.js
+++ b/jstests/core/txns/timestamped_reads_wait_for_prepare_oplog_visibility.js
@@ -2,7 +2,13 @@
* Tests that timestamped reads, reads with snapshot and afterClusterTime, wait for the prepare
* transaction oplog entry to be visible before choosing a read timestamp.
*
- * @tags: [uses_transactions, uses_prepare_transaction, uses_parallel_shell]
+ * @tags: [
+ * uses_transactions,
+ * uses_prepare_transaction,
+ * uses_parallel_shell,
+ * # 'setDefaultRWConcern' is not supposed to be run on shard nodes.
+ * command_not_supported_in_serverless,
+ * ]
*/
(function() {
'use strict';
diff --git a/jstests/core/views/views_aggregation.js b/jstests/core/views/views_aggregation.js
index 24cbba8c8e4..fd1277da546 100644
--- a/jstests/core/views/views_aggregation.js
+++ b/jstests/core/views/views_aggregation.js
@@ -7,6 +7,8 @@
* does_not_support_transactions,
* requires_getmore,
* requires_non_retryable_commands,
+ * # Explain of a resolved view must be executed by mongos.
+ * directly_against_shardsvrs_incompatible,
* ]
*/
(function() {
diff --git a/jstests/core/views/views_collation.js b/jstests/core/views/views_collation.js
index bca3f109548..169e9309740 100644
--- a/jstests/core/views/views_collation.js
+++ b/jstests/core/views/views_collation.js
@@ -4,6 +4,8 @@
// does_not_support_stepdowns,
// requires_fastcount,
// requires_non_retryable_commands,
+// # Explain of a resolved view must be executed by mongos.
+// directly_against_shardsvrs_incompatible,
// ]
/**
diff --git a/jstests/core/views/views_count.js b/jstests/core/views/views_count.js
index 125e6e1c0ab..f175b20c864 100644
--- a/jstests/core/views/views_count.js
+++ b/jstests/core/views/views_count.js
@@ -3,6 +3,8 @@
// @tags: [
// assumes_unsharded_collection,
// requires_fastcount,
+// # Explain of a resolved view must be executed by mongos.
+// directly_against_shardsvrs_incompatible,
// ]
(function() {
diff --git a/jstests/core/views/views_distinct.js b/jstests/core/views/views_distinct.js
index 2d996b04da4..b5d019485cc 100644
--- a/jstests/core/views/views_distinct.js
+++ b/jstests/core/views/views_distinct.js
@@ -3,6 +3,8 @@
*
* @tags: [
* assumes_unsharded_collection,
+ * # Explain of a resolved view must be executed by mongos.
+ * directly_against_shardsvrs_incompatible,
* ]
*/
diff --git a/jstests/core/views/views_find.js b/jstests/core/views/views_find.js
index ca2cac23347..e19fb5d32ba 100644
--- a/jstests/core/views/views_find.js
+++ b/jstests/core/views/views_find.js
@@ -4,6 +4,8 @@
* @tags: [
* assumes_unsharded_collection,
* requires_getmore,
+ * # Explain of a resolved view must be executed by mongos.
+ * directly_against_shardsvrs_incompatible,
* ]
*/
(function() {