diff options
Diffstat (limited to 'src')
4 files changed, 11 insertions, 4 deletions
diff --git a/src/mongo/db/commands/run_aggregate.cpp b/src/mongo/db/commands/run_aggregate.cpp index ccf2ef01760..71356f55cda 100644 --- a/src/mongo/db/commands/run_aggregate.cpp +++ b/src/mongo/db/commands/run_aggregate.cpp @@ -673,7 +673,9 @@ 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() && + if (serverGlobalParams.featureCompatibility.isVersionInitialized() && + feature_flags::gFeatureFlagSBELookupPushdown.isEnabled( + serverGlobalParams.featureCompatibility) && !internalQuerySlotBasedExecutionDisableLookupPushdown.load()) { secondaryExecNssList = liteParsedPipeline.getForeignExecutionNamespaces(); } diff --git a/src/mongo/db/pipeline/pipeline_d.cpp b/src/mongo/db/pipeline/pipeline_d.cpp index 63dfcc1a7e4..03e1d0f77f5 100644 --- a/src/mongo/db/pipeline/pipeline_d.cpp +++ b/src/mongo/db/pipeline/pipeline_d.cpp @@ -157,7 +157,9 @@ 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 = - !feature_flags::gFeatureFlagSBELookupPushdown.isEnabledAndIgnoreFCV() || + !(serverGlobalParams.featureCompatibility.isVersionInitialized() && + feature_flags::gFeatureFlagSBELookupPushdown.isEnabled( + serverGlobalParams.featureCompatibility)) || 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 80334058987..2dd640821e0 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,7 +434,9 @@ 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() && + if (serverGlobalParams.featureCompatibility.isVersionInitialized() && + feature_flags::gFeatureFlagSBELookupPushdown.isEnabled( + serverGlobalParams.featureCompatibility) && !internalQuerySlotBasedExecutionDisableLookupPushdown.load()) { auto lpp = LiteParsedPipeline(expCtx->ns, pipeline->serializeToBson()); return lpp.getForeignExecutionNamespaces(); diff --git a/src/mongo/db/query/query_feature_flags.idl b/src/mongo/db/query/query_feature_flags.idl index 8e2632c893a..084d606ff14 100644 --- a/src/mongo/db/query/query_feature_flags.idl +++ b/src/mongo/db/query/query_feature_flags.idl @@ -132,7 +132,8 @@ feature_flags: featureFlagSBELookupPushdown: description: "Feature flag for allowing SBE $lookup pushdown" cpp_varname: gFeatureFlagSBELookupPushdown - default: false + default: true + version: 6.0 featureFlagSearchShardedFacets: description: "Enable use of $$SEARCH_META on sharded collections" |