summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMihai Andrei <mihai.andrei@10gen.com>2022-04-22 14:30:28 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-04-22 15:01:37 +0000
commit11c173924669a695129bee260d01a1fd09d20523 (patch)
tree419ceadf2c40703d8b6c17e926931a48af613322
parent0a16e785f7016c92fb3357377ef2d6d50db3ffc9 (diff)
downloadmongo-11c173924669a695129bee260d01a1fd09d20523.tar.gz
SERVER-65695 Delete checks for atomic query knobs when getting secondary namespaces
(cherry picked from commit 8a5e1910c19b1479aca4ae8d513c030dd5657dc7)
-rw-r--r--jstests/aggregation/sources/lookup/profile_lookup.js7
-rw-r--r--jstests/sharding/query/lookup_graph_lookup_foreign_becomes_sharded.js10
-rw-r--r--src/mongo/db/commands/run_aggregate.cpp4
-rw-r--r--src/mongo/db/pipeline/process_interface/common_mongod_process_interface.cpp4
4 files changed, 15 insertions, 10 deletions
diff --git a/jstests/aggregation/sources/lookup/profile_lookup.js b/jstests/aggregation/sources/lookup/profile_lookup.js
index 868f5ed2386..ac25dedc54c 100644
--- a/jstests/aggregation/sources/lookup/profile_lookup.js
+++ b/jstests/aggregation/sources/lookup/profile_lookup.js
@@ -47,7 +47,12 @@ const actualCount = newTop.totals[foreignColl.getFullName()].commands.count -
// because when executing $lookup in the classic engine, we will add one entry to top for the
// foreign collection for each document in the local collection (of which there are three).
let expectedCount = 0;
-if (checkSBEEnabled(db, ["featureFlagSBELookupPushdown"])) {
+const getFeatureFlagSBELookupPushdown =
+ db.adminCommand({getParameter: 1, featureFlagSBELookupPushdown: 1});
+const isSBELookupPushdownEnabled =
+ getFeatureFlagSBELookupPushdown.hasOwnProperty("featureFlagSBELookupPushdown") &&
+ getFeatureFlagSBELookupPushdown["featureFlagSBELookupPushdown"]["value"];
+if (isSBELookupPushdownEnabled) {
expectedCount++;
}
const eqLookupNodes = getAggPlanStages(localColl.explain().aggregate(pipeline), "EQ_LOOKUP");
diff --git a/jstests/sharding/query/lookup_graph_lookup_foreign_becomes_sharded.js b/jstests/sharding/query/lookup_graph_lookup_foreign_becomes_sharded.js
index 99e0e88cab9..c3924654a74 100644
--- a/jstests/sharding/query/lookup_graph_lookup_foreign_becomes_sharded.js
+++ b/jstests/sharding/query/lookup_graph_lookup_foreign_becomes_sharded.js
@@ -114,10 +114,14 @@ const getShardedLookupParam = st.s.adminCommand({getParameter: 1, featureFlagSha
const isShardedLookupEnabled = getShardedLookupParam.hasOwnProperty("featureFlagShardedLookup") &&
getShardedLookupParam.featureFlagShardedLookup.value;
-let res = shard0.getPrimary().getDB("admin").adminCommand(
- {getParameter: 1, featureFlagSBELookupPushdown: 1});
+let res = st.getPrimaryShard(jsTestName()).getDB("admin").adminCommand({
+ getParameter: 1,
+ featureFlagSBELookupPushdown: 1,
+ internalQueryForceClassicEngine: 1
+});
let isSBELookupEnabled = res.ok && res.hasOwnProperty("featureFlagSBELookupPushdown") &&
- res.featureFlagSBELookupPushdown.value;
+ res.hasOwnProperty("internalQueryForceClassicEngine") &&
+ res.featureFlagSBELookupPushdown.value && !res.internalQueryForceClassicEngine;
// Now run a getMore for each of the test cases. The collection has become sharded mid-iteration, so
// we should observe the error code associated with the test case.
diff --git a/src/mongo/db/commands/run_aggregate.cpp b/src/mongo/db/commands/run_aggregate.cpp
index f7304c4b095..89239fc8713 100644
--- a/src/mongo/db/commands/run_aggregate.cpp
+++ b/src/mongo/db/commands/run_aggregate.cpp
@@ -683,9 +683,7 @@ Status runAggregate(OperationContext* opCtx,
std::vector<NamespaceStringOrUUID> secondaryExecNssList;
// Taking locks over multiple collections is not supported outside of $lookup pushdown.
- if (feature_flags::gFeatureFlagSBELookupPushdown.isEnabledAndIgnoreFCV() &&
- !internalQuerySlotBasedExecutionDisableLookupPushdown.load() &&
- !internalQueryForceClassicEngine.load()) {
+ if (feature_flags::gFeatureFlagSBELookupPushdown.isEnabledAndIgnoreFCV()) {
secondaryExecNssList = liteParsedPipeline.getForeignExecutionNamespaces();
}
diff --git a/src/mongo/db/pipeline/process_interface/common_mongod_process_interface.cpp b/src/mongo/db/pipeline/process_interface/common_mongod_process_interface.cpp
index 7ad03e7c517..469ce5821aa 100644
--- a/src/mongo/db/pipeline/process_interface/common_mongod_process_interface.cpp
+++ b/src/mongo/db/pipeline/process_interface/common_mongod_process_interface.cpp
@@ -434,9 +434,7 @@ CommonMongodProcessInterface::attachCursorSourceToPipelineForLocalRead(Pipeline*
// Reparse 'pipeline' to discover whether there are secondary namespaces that we need to lock
// when constructing our query executor.
std::vector<NamespaceStringOrUUID> secondaryNamespaces = [&]() {
- if (feature_flags::gFeatureFlagSBELookupPushdown.isEnabledAndIgnoreFCV() &&
- !internalQuerySlotBasedExecutionDisableLookupPushdown.load() &&
- !internalQueryForceClassicEngine.load()) {
+ if (feature_flags::gFeatureFlagSBELookupPushdown.isEnabledAndIgnoreFCV()) {
auto lpp = LiteParsedPipeline(expCtx->ns, pipeline->serializeToBson());
return lpp.getForeignExecutionNamespaces();
} else {