summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaddie Zechar <mez2113@columbia.edu>2022-08-22 23:08:17 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-08-23 00:13:22 +0000
commitb99b5c3e242ff690b5127c5d672d226f7eaf5754 (patch)
tree14a9ca66886507db182db20e838541132286b671
parent9ce6107036523ec56dfee4e714ca76e9103198ad (diff)
downloadmongo-b99b5c3e242ff690b5127c5d672d226f7eaf5754.tar.gz
SERVER-67587 Remove featureFlagSearchShardedFacets
-rw-r--r--src/mongo/db/pipeline/document_source_set_variable_from_subpipeline.cpp11
-rw-r--r--src/mongo/db/pipeline/search_helper.h9
-rw-r--r--src/mongo/db/pipeline/sharded_agg_helpers.cpp19
-rw-r--r--src/mongo/db/query/query_feature_flags.idl6
4 files changed, 4 insertions, 41 deletions
diff --git a/src/mongo/db/pipeline/document_source_set_variable_from_subpipeline.cpp b/src/mongo/db/pipeline/document_source_set_variable_from_subpipeline.cpp
index bd0509eb609..e7e0c249a21 100644
--- a/src/mongo/db/pipeline/document_source_set_variable_from_subpipeline.cpp
+++ b/src/mongo/db/pipeline/document_source_set_variable_from_subpipeline.cpp
@@ -48,13 +48,10 @@ using boost::intrusive_ptr;
constexpr StringData DocumentSourceSetVariableFromSubPipeline::kStageName;
-REGISTER_INTERNAL_DOCUMENT_SOURCE(
- setVariableFromSubPipeline,
- LiteParsedDocumentSourceDefault::parse,
- DocumentSourceSetVariableFromSubPipeline::createFromBson,
- // This can only be generated in certain versions, and registering document sources is too early
- // to check the FCV.
- feature_flags::gFeatureFlagSearchShardedFacets.isEnabledAndIgnoreFCV());
+REGISTER_INTERNAL_DOCUMENT_SOURCE(setVariableFromSubPipeline,
+ LiteParsedDocumentSourceDefault::parse,
+ DocumentSourceSetVariableFromSubPipeline::createFromBson,
+ true);
Value DocumentSourceSetVariableFromSubPipeline::serialize(
boost::optional<ExplainOptions::Verbosity> explain) const {
diff --git a/src/mongo/db/pipeline/search_helper.h b/src/mongo/db/pipeline/search_helper.h
index 8c348bf583b..62d0ecb6c15 100644
--- a/src/mongo/db/pipeline/search_helper.h
+++ b/src/mongo/db/pipeline/search_helper.h
@@ -69,15 +69,6 @@ public:
boost::optional<UUID> uuid) {
return nullptr;
}
-
- /**
- * Check if the passed in pipeline is valid in a sharded collection. If it is not, return the
- * error message, otherwise return boost::none.
- */
- virtual boost::optional<std::string> validatePipelineForShardedCollection(
- const Pipeline& pipeline) {
- return boost::none;
- }
};
/**
diff --git a/src/mongo/db/pipeline/sharded_agg_helpers.cpp b/src/mongo/db/pipeline/sharded_agg_helpers.cpp
index 0ec9f8571c1..13ddc42253d 100644
--- a/src/mongo/db/pipeline/sharded_agg_helpers.cpp
+++ b/src/mongo/db/pipeline/sharded_agg_helpers.cpp
@@ -1059,14 +1059,6 @@ DispatchShardPipelineResults dispatchShardPipeline(
boost::optional<ShardedExchangePolicy> exchangeSpec;
boost::optional<SplitPipeline> splitPipelines;
- // If set, the pipeline is not valid to be run if the collection is sharded. The given string
- // is the error message to print if the collection is sharded.
- boost::optional<std::string> errMsgOnShardedCollection = boost::none;
- auto srvcCtxt = opCtx->getServiceContext();
- if (srvcCtxt && pipeline) {
- errMsgOnShardedCollection =
- getSearchHelpers(srvcCtxt)->validatePipelineForShardedCollection(*pipeline.get());
- }
if (needsSplit) {
LOGV2_DEBUG(20906,
@@ -1173,22 +1165,11 @@ DispatchShardPipelineResults dispatchShardPipeline(
// else.
auto staleInfo = e.extraInfo<StaleConfigInfo>();
tassert(6441003, "StaleConfigInfo was null during sharded aggregation", staleInfo);
- if (errMsgOnShardedCollection && staleInfo->getVersionWanted() &&
- staleInfo->getVersionWanted() != ChunkVersion::UNSHARDED()) {
- // If we thought the collection was not sharded, we were wrong. Collection must be
- // sharded.
- uassert(5858100, *errMsgOnShardedCollection, executionNsRoutingInfo->isSharded());
- }
throw;
} catch (const ExceptionFor<ErrorCodes::CollectionUUIDMismatch>& ex) {
uassertStatusOK(populateCollectionUUIDMismatch(opCtx, ex.toStatus()));
MONGO_UNREACHABLE_TASSERT(6487201);
}
- // If we thought the collection was sharded and the shard confirmed this, fail if the query
- // isn't valid on a sharded collection.
- uassert(6347900,
- *errMsgOnShardedCollection,
- !errMsgOnShardedCollection || !executionNsRoutingInfo->isSharded());
invariant(cursors.size() % shardIds.size() == 0,
str::stream() << "Number of cursors (" << cursors.size()
diff --git a/src/mongo/db/query/query_feature_flags.idl b/src/mongo/db/query/query_feature_flags.idl
index b1ae1a4acff..be524382d81 100644
--- a/src/mongo/db/query/query_feature_flags.idl
+++ b/src/mongo/db/query/query_feature_flags.idl
@@ -59,12 +59,6 @@ feature_flags:
cpp_varname: gFeatureFlagCommonQueryFramework
default: false
- featureFlagSearchShardedFacets:
- description: "Enable use of $$SEARCH_META on sharded collections"
- cpp_varname: gFeatureFlagSearchShardedFacets
- default: true
- version: 6.0
-
featureFlagBucketUnpackWithSort:
description: "Enables a time-series optimization that allows for partially-blocking sort on time"
cpp_varname: gFeatureFlagBucketUnpackWithSort