diff options
author | Yoonsoo Kim <yoonsoo.kim@mongodb.com> | 2022-04-18 15:26:07 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-04-18 23:32:39 +0000 |
commit | 69796a5d7a9e10dbb5def8ec3e7248d39e6ca79a (patch) | |
tree | 09b92f1b1230ccaacdacbf230836c3c558c0534f | |
parent | 35eccb21e823777f5d5f415b9c9954a64ce904a7 (diff) | |
download | mongo-69796a5d7a9e10dbb5def8ec3e7248d39e6ca79a.tar.gz |
SERVER-65707 Remove FCV-gating for $lookup pushdown
4 files changed, 5 insertions, 17 deletions
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 4a0e65db1cb..99e0e88cab9 100644 --- a/jstests/sharding/query/lookup_graph_lookup_foreign_becomes_sharded.js +++ b/jstests/sharding/query/lookup_graph_lookup_foreign_becomes_sharded.js @@ -116,11 +116,8 @@ const isShardedLookupEnabled = getShardedLookupParam.hasOwnProperty("featureFlag let res = shard0.getPrimary().getDB("admin").adminCommand( {getParameter: 1, featureFlagSBELookupPushdown: 1}); -let fcvCmdRes = assert.commandWorked(shard0.getPrimary().getDB("admin").adminCommand( - {getParameter: 1, featureCompatibilityVersion: 1})); let isSBELookupEnabled = res.ok && res.hasOwnProperty("featureFlagSBELookupPushdown") && - res.featureFlagSBELookupPushdown.value && - parseFloat(fcvCmdRes.featureCompatibilityVersion.version) >= 6.0; + res.featureFlagSBELookupPushdown.value; // 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. @@ -201,11 +198,8 @@ shard0.restart(shard0.getPrimary()); // is running after restart. res = shard0.getPrimary().getDB("admin").adminCommand( {getParameter: 1, featureFlagSBELookupPushdown: 1}); -fcvCmdRes = assert.commandWorked(shard0.getPrimary().getDB("admin").adminCommand( - {getParameter: 1, featureCompatibilityVersion: 1})); isSBELookupEnabled = res.ok && res.hasOwnProperty("featureFlagSBELookupPushdown") && - res.featureFlagSBELookupPushdown.value && - parseFloat(fcvCmdRes.featureCompatibilityVersion.version) >= 6.0; + res.featureFlagSBELookupPushdown.value; // Enable profiling on shard0 to capture stale shard version exceptions. const primaryDB = shard0.getPrimary().getDB(jsTestName()); diff --git a/src/mongo/db/commands/run_aggregate.cpp b/src/mongo/db/commands/run_aggregate.cpp index 13d31c99ace..f7304c4b095 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 (serverGlobalParams.featureCompatibility.isVersionInitialized() && - feature_flags::gFeatureFlagSBELookupPushdown.isEnabled( - serverGlobalParams.featureCompatibility) && + if (feature_flags::gFeatureFlagSBELookupPushdown.isEnabledAndIgnoreFCV() && !internalQuerySlotBasedExecutionDisableLookupPushdown.load() && !internalQueryForceClassicEngine.load()) { secondaryExecNssList = liteParsedPipeline.getForeignExecutionNamespaces(); diff --git a/src/mongo/db/pipeline/pipeline_d.cpp b/src/mongo/db/pipeline/pipeline_d.cpp index 36899095c63..b4e9334ff3d 100644 --- a/src/mongo/db/pipeline/pipeline_d.cpp +++ b/src/mongo/db/pipeline/pipeline_d.cpp @@ -160,9 +160,7 @@ std::vector<std::unique_ptr<InnerPipelineStageInterface>> extractSbeCompatibleSt // sharded and which ones aren't. As such, if any secondary collection is a view or is sharded, // no $lookup will be eligible for pushdown. const bool disallowLookupPushdown = - !(serverGlobalParams.featureCompatibility.isVersionInitialized() && - feature_flags::gFeatureFlagSBELookupPushdown.isEnabled( - serverGlobalParams.featureCompatibility)) || + !feature_flags::gFeatureFlagSBELookupPushdown.isEnabledAndIgnoreFCV() || internalQuerySlotBasedExecutionDisableLookupPushdown.load() || isMainCollectionSharded || collections.isAnySecondaryNamespaceAViewOrSharded(); 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 9b0b8921cfa..7ad03e7c517 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 (serverGlobalParams.featureCompatibility.isVersionInitialized() && - feature_flags::gFeatureFlagSBELookupPushdown.isEnabled( - serverGlobalParams.featureCompatibility) && + if (feature_flags::gFeatureFlagSBELookupPushdown.isEnabledAndIgnoreFCV() && !internalQuerySlotBasedExecutionDisableLookupPushdown.load() && !internalQueryForceClassicEngine.load()) { auto lpp = LiteParsedPipeline(expCtx->ns, pipeline->serializeToBson()); |