summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--jstests/replsets/all_commands_downgrading_to_upgraded.js4
-rw-r--r--src/mongo/db/mongod_main.cpp16
-rw-r--r--src/mongo/db/pipeline/document_source_list_sampled_queries.cpp10
-rw-r--r--src/mongo/db/s/analyze_shard_key_cmd.cpp6
-rw-r--r--src/mongo/db/s/configure_query_analyzer_cmd.cpp6
-rw-r--r--src/mongo/db/s/document_source_analyze_shard_key_read_write_distribution.cpp11
-rw-r--r--src/mongo/db/s/query_analysis_coordinator.cpp4
-rw-r--r--src/mongo/db/s/query_analysis_coordinator_test.cpp1
-rw-r--r--src/mongo/db/s/query_analysis_writer.cpp4
-rw-r--r--src/mongo/db/s/query_analysis_writer_test.cpp3
-rw-r--r--src/mongo/db/s/refresh_query_analyzer_configuration_cmd.cpp6
-rw-r--r--src/mongo/s/SConscript1
-rw-r--r--src/mongo/s/analyze_shard_key_role.cpp42
-rw-r--r--src/mongo/s/analyze_shard_key_role.h14
-rw-r--r--src/mongo/s/commands/cluster_analyze_shard_key_cmd.cpp6
-rw-r--r--src/mongo/s/commands/cluster_configure_query_analyzer_cmd.cpp6
-rw-r--r--src/mongo/s/mongos_main.cpp7
-rw-r--r--src/mongo/s/query_analysis_sampler.cpp2
-rw-r--r--src/mongo/s/query_analysis_sampler_test.cpp7
-rw-r--r--src/mongo/s/sharding_initialization.cpp10
20 files changed, 45 insertions, 121 deletions
diff --git a/jstests/replsets/all_commands_downgrading_to_upgraded.js b/jstests/replsets/all_commands_downgrading_to_upgraded.js
index dcf820f0186..d4c66020fd5 100644
--- a/jstests/replsets/all_commands_downgrading_to_upgraded.js
+++ b/jstests/replsets/all_commands_downgrading_to_upgraded.js
@@ -240,8 +240,6 @@ const allCommands = {
analyzeShardKey: {
// TODO SERVER-74867: Remove the skip once 7.0 is lastLTS.
skip: commandIsDisabledOnLastLTS,
- // TODO SERVER-67966: Remove check when this feature flag is removed.
- checkFeatureFlag: "AnalyzeShardKey",
setUp: function(conn) {
assert.commandWorked(conn.getDB(dbName).runCommand({create: collName}));
assert.commandWorked(
@@ -507,8 +505,6 @@ const allCommands = {
configureQueryAnalyzer: {
// TODO SERVER-74867: Remove the skip once 7.0 is lastLTS.
skip: commandIsDisabledOnLastLTS,
- // TODO SERVER-67966: Remove check when this feature flag is removed.
- checkFeatureFlag: "AnalyzeShardKey",
setUp: function(conn) {
assert.commandWorked(conn.getDB(dbName).runCommand({create: collName}));
for (let i = 0; i < 10; i++) {
diff --git a/src/mongo/db/mongod_main.cpp b/src/mongo/db/mongod_main.cpp
index 636852ed088..01b9fef468e 100644
--- a/src/mongo/db/mongod_main.cpp
+++ b/src/mongo/db/mongod_main.cpp
@@ -928,7 +928,7 @@ ExitCode _initAndListen(ServiceContext* serviceContext, int listenPort) {
LogicalSessionCache::set(serviceContext, makeLogicalSessionCacheD(kind));
- if (analyze_shard_key::supportsSamplingQueries(serviceContext, true /* ignoreFCV */) &&
+ if (analyze_shard_key::supportsSamplingQueries(serviceContext) &&
serverGlobalParams.clusterRole.has(ClusterRole::None)) {
analyze_shard_key::QueryAnalysisSampler::get(serviceContext).onStartup();
}
@@ -1244,14 +1244,10 @@ void setUpReplication(ServiceContext* serviceContext) {
ReplicaSetNodeProcessInterface::setReplicaSetNodeExecutor(
serviceContext, makeReplicaSetNodeExecutor(serviceContext));
- // The check below ignores the FCV because FCV is not initialized until after the replica
- // set is initiated.
- if (analyze_shard_key::isFeatureFlagEnabled(true /* ignoreFCV */)) {
- analyze_shard_key::QueryAnalysisClient::get(serviceContext)
- .setTaskExecutor(
- serviceContext,
- ReplicaSetNodeProcessInterface::getReplicaSetNodeExecutor(serviceContext));
- }
+ analyze_shard_key::QueryAnalysisClient::get(serviceContext)
+ .setTaskExecutor(
+ serviceContext,
+ ReplicaSetNodeProcessInterface::getReplicaSetNodeExecutor(serviceContext));
}
repl::ReplicationCoordinator::set(serviceContext, std::move(replCoord));
@@ -1444,7 +1440,7 @@ void shutdownTask(const ShutdownTaskArgs& shutdownArgs) {
lsc->joinOnShutDown();
}
- if (analyze_shard_key::supportsSamplingQueries(serviceContext, true /* ignoreFCV */)) {
+ if (analyze_shard_key::supportsSamplingQueries(serviceContext)) {
LOGV2_OPTIONS(7350601, {LogComponent::kDefault}, "Shutting down the QueryAnalysisSampler");
analyze_shard_key::QueryAnalysisSampler::get(serviceContext).onShutdown();
}
diff --git a/src/mongo/db/pipeline/document_source_list_sampled_queries.cpp b/src/mongo/db/pipeline/document_source_list_sampled_queries.cpp
index 2caa1fa442e..5fdecf0dd8a 100644
--- a/src/mongo/db/pipeline/document_source_list_sampled_queries.cpp
+++ b/src/mongo/db/pipeline/document_source_list_sampled_queries.cpp
@@ -32,18 +32,16 @@
#include "mongo/db/dbdirectclient.h"
#include "mongo/logv2/log.h"
#include "mongo/s/analyze_shard_key_documents_gen.h"
-#include "mongo/s/analyze_shard_key_feature_flag_gen.h"
#define MONGO_LOGV2_DEFAULT_COMPONENT ::mongo::logv2::LogComponent::kSharding
namespace mongo {
namespace analyze_shard_key {
-REGISTER_DOCUMENT_SOURCE_WITH_FEATURE_FLAG(listSampledQueries,
- DocumentSourceListSampledQueries::LiteParsed::parse,
- DocumentSourceListSampledQueries::createFromBson,
- AllowedWithApiStrict::kNeverInVersion1,
- analyze_shard_key::gFeatureFlagAnalyzeShardKey);
+REGISTER_DOCUMENT_SOURCE(listSampledQueries,
+ DocumentSourceListSampledQueries::LiteParsed::parse,
+ DocumentSourceListSampledQueries::createFromBson,
+ AllowedWithApiStrict::kNeverInVersion1);
boost::intrusive_ptr<DocumentSource> DocumentSourceListSampledQueries::createFromBson(
BSONElement specElem, const boost::intrusive_ptr<ExpressionContext>& pExpCtx) {
diff --git a/src/mongo/db/s/analyze_shard_key_cmd.cpp b/src/mongo/db/s/analyze_shard_key_cmd.cpp
index ac6475ebeac..11698c703c7 100644
--- a/src/mongo/db/s/analyze_shard_key_cmd.cpp
+++ b/src/mongo/db/s/analyze_shard_key_cmd.cpp
@@ -36,7 +36,6 @@
#include "mongo/db/s/shard_key_index_util.h"
#include "mongo/logv2/log.h"
#include "mongo/s/analyze_shard_key_cmd_gen.h"
-#include "mongo/s/analyze_shard_key_feature_flag_gen.h"
#include "mongo/s/analyze_shard_key_util.h"
#define MONGO_LOGV2_DEFAULT_COMPONENT ::mongo::logv2::LogComponent::kCommand
@@ -145,10 +144,7 @@ public:
std::string help() const override {
return "Returns metrics for evaluating a shard key for a collection.";
}
-};
-
-MONGO_REGISTER_FEATURE_FLAGGED_COMMAND(AnalyzeShardKeyCmd,
- analyze_shard_key::gFeatureFlagAnalyzeShardKey);
+} analyzeShardKeyCmd;
} // namespace
diff --git a/src/mongo/db/s/configure_query_analyzer_cmd.cpp b/src/mongo/db/s/configure_query_analyzer_cmd.cpp
index 84b6fd11dbf..b40c0d2396c 100644
--- a/src/mongo/db/s/configure_query_analyzer_cmd.cpp
+++ b/src/mongo/db/s/configure_query_analyzer_cmd.cpp
@@ -40,7 +40,6 @@
#include "mongo/db/s/sharding_ddl_coordinator_service.h"
#include "mongo/logv2/log.h"
#include "mongo/s/analyze_shard_key_documents_gen.h"
-#include "mongo/s/analyze_shard_key_feature_flag_gen.h"
#include "mongo/s/analyze_shard_key_util.h"
#include "mongo/s/configure_query_analyzer_cmd_gen.h"
#include "mongo/s/grid.h"
@@ -289,10 +288,7 @@ public:
return "Starts or stops collecting metrics about read and write queries against a "
"collection.";
}
-};
-
-MONGO_REGISTER_FEATURE_FLAGGED_COMMAND(ConfigureQueryAnalyzerCmd,
- analyze_shard_key::gFeatureFlagAnalyzeShardKey);
+} configureQueryAnalyzerCmd;
} // namespace
diff --git a/src/mongo/db/s/document_source_analyze_shard_key_read_write_distribution.cpp b/src/mongo/db/s/document_source_analyze_shard_key_read_write_distribution.cpp
index d3d43f07ae9..c0a38e0a169 100644
--- a/src/mongo/db/s/document_source_analyze_shard_key_read_write_distribution.cpp
+++ b/src/mongo/db/s/document_source_analyze_shard_key_read_write_distribution.cpp
@@ -36,7 +36,6 @@
#include "mongo/db/vector_clock.h"
#include "mongo/logv2/log.h"
#include "mongo/s/analyze_shard_key_documents_gen.h"
-#include "mongo/s/analyze_shard_key_feature_flag_gen.h"
#include "mongo/s/collection_routing_info_targeter.h"
#include "mongo/s/grid.h"
@@ -292,12 +291,10 @@ void processSampledDiffs(OperationContext* opCtx,
} // namespace
-REGISTER_DOCUMENT_SOURCE_WITH_FEATURE_FLAG(
- _analyzeShardKeyReadWriteDistribution,
- DocumentSourceAnalyzeShardKeyReadWriteDistribution::LiteParsed::parse,
- DocumentSourceAnalyzeShardKeyReadWriteDistribution::createFromBson,
- AllowedWithApiStrict::kNeverInVersion1,
- analyze_shard_key::gFeatureFlagAnalyzeShardKey);
+REGISTER_DOCUMENT_SOURCE(_analyzeShardKeyReadWriteDistribution,
+ DocumentSourceAnalyzeShardKeyReadWriteDistribution::LiteParsed::parse,
+ DocumentSourceAnalyzeShardKeyReadWriteDistribution::createFromBson,
+ AllowedWithApiStrict::kNeverInVersion1);
boost::intrusive_ptr<DocumentSource>
DocumentSourceAnalyzeShardKeyReadWriteDistribution::createFromBson(
diff --git a/src/mongo/db/s/query_analysis_coordinator.cpp b/src/mongo/db/s/query_analysis_coordinator.cpp
index 9979c87f971..770e778a308 100644
--- a/src/mongo/db/s/query_analysis_coordinator.cpp
+++ b/src/mongo/db/s/query_analysis_coordinator.cpp
@@ -65,9 +65,7 @@ QueryAnalysisCoordinator* QueryAnalysisCoordinator::get(ServiceContext* serviceC
}
bool QueryAnalysisCoordinator::shouldRegisterReplicaSetAwareService() const {
- // This is invoked when the Register above is constructed which is before FCV is set so we need
- // to ignore FCV when checking if the feature flag is enabled.
- return supportsCoordinatingQueryAnalysis(true /* isReplEnabled */, true /* ignoreFCV */);
+ return supportsCoordinatingQueryAnalysis(true /* isReplEnabled */);
}
void QueryAnalysisCoordinator::onConfigurationInsert(const QueryAnalyzerDocument& doc) {
diff --git a/src/mongo/db/s/query_analysis_coordinator_test.cpp b/src/mongo/db/s/query_analysis_coordinator_test.cpp
index 93ca5c3ac0f..c65012c3028 100644
--- a/src/mongo/db/s/query_analysis_coordinator_test.cpp
+++ b/src/mongo/db/s/query_analysis_coordinator_test.cpp
@@ -173,7 +173,6 @@ protected:
private:
const std::shared_ptr<ClockSourceMock> _mockClock = std::make_shared<ClockSourceMock>();
- RAIIServerParameterControllerForTest _featureFlagController{"featureFlagAnalyzeShardKey", true};
RAIIServerParameterControllerForTest _inactiveThresholdController{
"queryAnalysisSamplerInActiveThresholdSecs", inActiveThresholdSecs};
};
diff --git a/src/mongo/db/s/query_analysis_writer.cpp b/src/mongo/db/s/query_analysis_writer.cpp
index 7404066b9c9..67a170f734a 100644
--- a/src/mongo/db/s/query_analysis_writer.cpp
+++ b/src/mongo/db/s/query_analysis_writer.cpp
@@ -290,9 +290,7 @@ QueryAnalysisWriter* QueryAnalysisWriter::get(ServiceContext* serviceContext) {
}
bool QueryAnalysisWriter::shouldRegisterReplicaSetAwareService() const {
- // This is invoked when the Register above is constructed which is before FCV is set so we need
- // to ignore FCV when checking if the feature flag is enabled.
- return supportsPersistingSampledQueries(true /* isReplEnabled */, true /* ignoreFCV */);
+ return supportsPersistingSampledQueries(true /* isReplEnabled */);
}
void QueryAnalysisWriter::onStartup(OperationContext* opCtx) {
diff --git a/src/mongo/db/s/query_analysis_writer_test.cpp b/src/mongo/db/s/query_analysis_writer_test.cpp
index c40e596a7d3..5d532ca53ad 100644
--- a/src/mongo/db/s/query_analysis_writer_test.cpp
+++ b/src/mongo/db/s/query_analysis_writer_test.cpp
@@ -506,7 +506,6 @@ private:
return cursor->next();
}
- RAIIServerParameterControllerForTest _featureFlagController{"featureFlagAnalyzeShardKey", true};
// This fixture manually flushes sampled queries and diffs.
FailPointEnableBlock _fp{"disableQueryAnalysisWriterFlusher"};
PseudoRandom _random{SecureRandom{}.nextInt64()};
@@ -974,7 +973,6 @@ TEST_F(QueryAnalysisWriterTest, QueriesMultipleBatches_MaxBatchSize) {
}
TEST_F(QueryAnalysisWriterTest, QueriesMultipleBatchesFewQueries_MaxBSONObjSize) {
- RAIIServerParameterControllerForTest featureFlagController("featureFlagAnalyzeShardKey", true);
auto& writer = *QueryAnalysisWriter::get(operationContext());
auto numQueries = 3;
@@ -999,7 +997,6 @@ TEST_F(QueryAnalysisWriterTest, QueriesMultipleBatchesFewQueries_MaxBSONObjSize)
}
TEST_F(QueryAnalysisWriterTest, QueriesMultipleBatchesManyQueries_MaxBSONObjSize) {
- RAIIServerParameterControllerForTest featureFlagController("featureFlagAnalyzeShardKey", true);
auto& writer = *QueryAnalysisWriter::get(operationContext());
auto numQueries = 75'000;
diff --git a/src/mongo/db/s/refresh_query_analyzer_configuration_cmd.cpp b/src/mongo/db/s/refresh_query_analyzer_configuration_cmd.cpp
index 0efae360f48..6361eef0c3b 100644
--- a/src/mongo/db/s/refresh_query_analyzer_configuration_cmd.cpp
+++ b/src/mongo/db/s/refresh_query_analyzer_configuration_cmd.cpp
@@ -34,7 +34,6 @@
#include "mongo/db/repl/replication_coordinator.h"
#include "mongo/db/s/query_analysis_coordinator.h"
#include "mongo/logv2/log.h"
-#include "mongo/s/analyze_shard_key_feature_flag_gen.h"
#include "mongo/s/refresh_query_analyzer_configuration_cmd_gen.h"
#define MONGO_LOGV2_DEFAULT_COMPONENT ::mongo::logv2::LogComponent::kCommand
@@ -107,10 +106,7 @@ public:
std::string help() const override {
return "Refreshes the query analyzer configurations for all collections.";
}
-};
-
-MONGO_REGISTER_FEATURE_FLAGGED_COMMAND(RefreshQueryAnalyzerConfigurationCmd,
- analyze_shard_key::gFeatureFlagAnalyzeShardKey);
+} refreshQueryAnalyzerConfigurationCmd;
} // namespace
diff --git a/src/mongo/s/SConscript b/src/mongo/s/SConscript
index dce33a1c634..2ef620fa6eb 100644
--- a/src/mongo/s/SConscript
+++ b/src/mongo/s/SConscript
@@ -174,7 +174,6 @@ env.Library(
source=[
'analyze_shard_key_common.idl',
'analyze_shard_key_documents.idl',
- 'analyze_shard_key_feature_flag.idl',
'analyze_shard_key_server_parameters.idl',
'analyze_shard_key_role.cpp',
'query_analysis_sample_tracker.cpp',
diff --git a/src/mongo/s/analyze_shard_key_role.cpp b/src/mongo/s/analyze_shard_key_role.cpp
index 627bf186dee..c68f0e50491 100644
--- a/src/mongo/s/analyze_shard_key_role.cpp
+++ b/src/mongo/s/analyze_shard_key_role.cpp
@@ -31,7 +31,6 @@
#include "mongo/db/multitenancy_gen.h"
#include "mongo/db/repl/replication_coordinator.h"
-#include "mongo/s/analyze_shard_key_feature_flag_gen.h"
#include "mongo/s/is_mongos.h"
namespace mongo {
@@ -49,20 +48,7 @@ bool isReplEnabled(ServiceContext* serviceContext) {
} // namespace
-bool isFeatureFlagEnabled(bool ignoreFCV) {
- if (ignoreFCV) {
- // (Ignore FCV check): In the following cases, ignoreFCV is set to true.
- // 1. The call is before FCV initialization.
- // 2. We want to stop QueryAnalysisSampler regardless of FCV.
- return gFeatureFlagAnalyzeShardKey.isEnabledAndIgnoreFCVUnsafe();
- }
- return gFeatureFlagAnalyzeShardKey.isEnabled(serverGlobalParams.featureCompatibility);
-}
-
-bool supportsCoordinatingQueryAnalysis(bool isReplEnabled, bool ignoreFCV) {
- if (!isFeatureFlagEnabled(ignoreFCV)) {
- return false;
- }
+bool supportsCoordinatingQueryAnalysis(bool isReplEnabled) {
if (isMongos()) {
return false;
}
@@ -71,14 +57,11 @@ bool supportsCoordinatingQueryAnalysis(bool isReplEnabled, bool ignoreFCV) {
serverGlobalParams.clusterRole.has(ClusterRole::None));
}
-bool supportsCoordinatingQueryAnalysis(OperationContext* opCtx, bool ignoreFCV) {
- return supportsCoordinatingQueryAnalysis(isReplEnabled(opCtx->getServiceContext()), ignoreFCV);
+bool supportsCoordinatingQueryAnalysis(OperationContext* opCtx) {
+ return supportsCoordinatingQueryAnalysis(isReplEnabled(opCtx->getServiceContext()));
}
-bool supportsPersistingSampledQueries(bool isReplEnabled, bool ignoreFCV) {
- if (!isFeatureFlagEnabled(ignoreFCV)) {
- return false;
- }
+bool supportsPersistingSampledQueries(bool isReplEnabled) {
if (isMongos()) {
return false;
}
@@ -87,14 +70,11 @@ bool supportsPersistingSampledQueries(bool isReplEnabled, bool ignoreFCV) {
serverGlobalParams.clusterRole.has(ClusterRole::None));
}
-bool supportsPersistingSampledQueries(OperationContext* opCtx, bool ignoreFCV) {
- return supportsPersistingSampledQueries(isReplEnabled(opCtx->getServiceContext()), ignoreFCV);
+bool supportsPersistingSampledQueries(OperationContext* opCtx) {
+ return supportsPersistingSampledQueries(isReplEnabled(opCtx->getServiceContext()));
}
-bool supportsSamplingQueries(bool isReplEnabled, bool ignoreFCV) {
- if (!isFeatureFlagEnabled(ignoreFCV)) {
- return false;
- }
+bool supportsSamplingQueries(bool isReplEnabled) {
if (isMongos()) {
return true;
}
@@ -103,12 +83,12 @@ bool supportsSamplingQueries(bool isReplEnabled, bool ignoreFCV) {
serverGlobalParams.clusterRole.has(ClusterRole::None));
}
-bool supportsSamplingQueries(ServiceContext* serviceContext, bool ignoreFCV) {
- return supportsSamplingQueries(isReplEnabled(serviceContext), ignoreFCV);
+bool supportsSamplingQueries(ServiceContext* serviceContext) {
+ return supportsSamplingQueries(isReplEnabled(serviceContext));
}
-bool supportsSamplingQueries(OperationContext* opCtx, bool ignoreFCV) {
- return supportsSamplingQueries(opCtx->getServiceContext(), ignoreFCV);
+bool supportsSamplingQueries(OperationContext* opCtx) {
+ return supportsSamplingQueries(opCtx->getServiceContext());
}
} // namespace analyze_shard_key
diff --git a/src/mongo/s/analyze_shard_key_role.h b/src/mongo/s/analyze_shard_key_role.h
index 2c6ed7b3143..c3b93d4d48e 100644
--- a/src/mongo/s/analyze_shard_key_role.h
+++ b/src/mongo/s/analyze_shard_key_role.h
@@ -37,15 +37,15 @@ namespace analyze_shard_key {
bool isFeatureFlagEnabled(bool ignoreFCV = false);
-bool supportsCoordinatingQueryAnalysis(bool isReplEnabled, bool ignoreFCV = false);
-bool supportsCoordinatingQueryAnalysis(OperationContext* opCtx, bool ignoreFCV = false);
+bool supportsCoordinatingQueryAnalysis(bool isReplEnabled);
+bool supportsCoordinatingQueryAnalysis(OperationContext* opCtx);
-bool supportsPersistingSampledQueries(bool isReplEnabled, bool ignoreFCV = false);
-bool supportsPersistingSampledQueries(OperationContext* opCtx, bool ignoreFCV = false);
+bool supportsPersistingSampledQueries(bool isReplEnabled);
+bool supportsPersistingSampledQueries(OperationContext* opCtx);
-bool supportsSamplingQueries(bool isReplEnabled, bool ignoreFCV = false);
-bool supportsSamplingQueries(OperationContext* opCtx, bool ignoreFCV = false);
-bool supportsSamplingQueries(ServiceContext* serviceContext, bool ignoreFCV = false);
+bool supportsSamplingQueries(bool isReplEnabled);
+bool supportsSamplingQueries(OperationContext* opCtx);
+bool supportsSamplingQueries(ServiceContext* serviceContext);
} // namespace analyze_shard_key
} // namespace mongo
diff --git a/src/mongo/s/commands/cluster_analyze_shard_key_cmd.cpp b/src/mongo/s/commands/cluster_analyze_shard_key_cmd.cpp
index c04ad8cd926..d543eccfed4 100644
--- a/src/mongo/s/commands/cluster_analyze_shard_key_cmd.cpp
+++ b/src/mongo/s/commands/cluster_analyze_shard_key_cmd.cpp
@@ -34,7 +34,6 @@
#include "mongo/logv2/log.h"
#include "mongo/platform/random.h"
#include "mongo/s/analyze_shard_key_cmd_gen.h"
-#include "mongo/s/analyze_shard_key_feature_flag_gen.h"
#include "mongo/s/analyze_shard_key_util.h"
#include "mongo/s/cluster_commands_helpers.h"
#include "mongo/s/grid.h"
@@ -194,10 +193,7 @@ public:
std::string help() const override {
return "Returns metrics for evaluating a shard key for a collection.";
}
-};
-
-MONGO_REGISTER_FEATURE_FLAGGED_COMMAND(AnalyzeShardKeyCmd,
- analyze_shard_key::gFeatureFlagAnalyzeShardKey);
+} analyzeShardKeyCmd;
} // namespace
diff --git a/src/mongo/s/commands/cluster_configure_query_analyzer_cmd.cpp b/src/mongo/s/commands/cluster_configure_query_analyzer_cmd.cpp
index 1651018a09a..c149e2c9623 100644
--- a/src/mongo/s/commands/cluster_configure_query_analyzer_cmd.cpp
+++ b/src/mongo/s/commands/cluster_configure_query_analyzer_cmd.cpp
@@ -32,7 +32,6 @@
#include "mongo/db/auth/authorization_session.h"
#include "mongo/db/commands.h"
#include "mongo/logv2/log.h"
-#include "mongo/s/analyze_shard_key_feature_flag_gen.h"
#include "mongo/s/analyze_shard_key_util.h"
#include "mongo/s/cluster_commands_helpers.h"
#include "mongo/s/configure_query_analyzer_cmd_gen.h"
@@ -125,10 +124,7 @@ public:
return "Starts or stops collecting metrics about read and write queries against "
"collection.";
}
-};
-
-MONGO_REGISTER_FEATURE_FLAGGED_COMMAND(ConfigureQueryAnalyzerCmd,
- analyze_shard_key::gFeatureFlagAnalyzeShardKey);
+} configureQueryAnalyzerCmd;
} // namespace
diff --git a/src/mongo/s/mongos_main.cpp b/src/mongo/s/mongos_main.cpp
index 5688d9ae894..4e8f3f329a9 100644
--- a/src/mongo/s/mongos_main.cpp
+++ b/src/mongo/s/mongos_main.cpp
@@ -329,11 +329,8 @@ void cleanupTask(const ShutdownTaskArgs& shutdownArgs) {
lsc->joinOnShutDown();
}
- if (analyze_shard_key::isFeatureFlagEnabled()) {
- LOGV2_OPTIONS(
- 6973901, {LogComponent::kDefault}, "Shutting down the QueryAnalysisSampler");
- analyze_shard_key::QueryAnalysisSampler::get(serviceContext).onShutdown();
- }
+ LOGV2_OPTIONS(6973901, {LogComponent::kDefault}, "Shutting down the QueryAnalysisSampler");
+ analyze_shard_key::QueryAnalysisSampler::get(serviceContext).onShutdown();
ReplicaSetMonitor::shutdown();
diff --git a/src/mongo/s/query_analysis_sampler.cpp b/src/mongo/s/query_analysis_sampler.cpp
index 7f680dfd9a6..55094305475 100644
--- a/src/mongo/s/query_analysis_sampler.cpp
+++ b/src/mongo/s/query_analysis_sampler.cpp
@@ -108,7 +108,7 @@ QueryAnalysisSampler& QueryAnalysisSampler::get(OperationContext* opCtx) {
}
QueryAnalysisSampler& QueryAnalysisSampler::get(ServiceContext* serviceContext) {
- invariant(analyze_shard_key::supportsSamplingQueries(serviceContext, true /* ignoreFCV */));
+ invariant(analyze_shard_key::supportsSamplingQueries(serviceContext));
return getQueryAnalysisSampler(serviceContext);
}
diff --git a/src/mongo/s/query_analysis_sampler_test.cpp b/src/mongo/s/query_analysis_sampler_test.cpp
index 9a5eadf213c..90525584159 100644
--- a/src/mongo/s/query_analysis_sampler_test.cpp
+++ b/src/mongo/s/query_analysis_sampler_test.cpp
@@ -503,7 +503,6 @@ protected:
const UUID collUuid2 = UUID::gen();
private:
- RAIIServerParameterControllerForTest _featureFlagController{"featureFlagAnalyzeShardKey", true};
bool _originalIsMongos;
};
@@ -527,12 +526,6 @@ DEATH_TEST_F(QueryAnalysisSamplerTest, CannotGetOnStandaloneMongod, "invariant")
QueryAnalysisSampler::get(operationContext());
}
-DEATH_TEST_F(QueryAnalysisSamplerTest, CannotGetIfFeatureFlagNotEnabled, "invariant") {
- RAIIServerParameterControllerForTest _featureFlagController{"featureFlagAnalyzeShardKey",
- false};
- QueryAnalysisSampler::get(operationContext());
-}
-
class QueryAnalysisSamplerQueryStatsTest : public QueryAnalysisSamplerTest {
protected:
void testInitialCount() {
diff --git a/src/mongo/s/sharding_initialization.cpp b/src/mongo/s/sharding_initialization.cpp
index 26b214a03d0..057ff2108f9 100644
--- a/src/mongo/s/sharding_initialization.cpp
+++ b/src/mongo/s/sharding_initialization.cpp
@@ -213,13 +213,9 @@ Status initializeGlobalShardingState(
LogicalTimeValidator::set(service, std::make_unique<LogicalTimeValidator>(keyManager));
initializeTenantToShardCache(service);
- // The checks below ignore the FCV because FCV is not initialized until after the replica set
- // is initiated.
- if (analyze_shard_key::isFeatureFlagEnabled(true /* ignoreFCV */)) {
- analyze_shard_key::QueryAnalysisClient::get(opCtx).setTaskExecutor(
- service, Grid::get(service)->getExecutorPool()->getFixedExecutor());
- }
- if (analyze_shard_key::supportsSamplingQueries(service, true /* ignoreFCV */)) {
+ analyze_shard_key::QueryAnalysisClient::get(opCtx).setTaskExecutor(
+ service, Grid::get(service)->getExecutorPool()->getFixedExecutor());
+ if (analyze_shard_key::supportsSamplingQueries(service)) {
analyze_shard_key::QueryAnalysisSampler::get(service).onStartup();
}