summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLouis Williams <louis.williams@mongodb.com>2022-12-15 09:27:38 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-12-15 10:02:47 +0000
commitd4082c855140f25957d9ad9be6b8056413be9d3e (patch)
tree4cd04275c9258084bcad00c69753723e22a4812e
parentd3362e6dcef0d22074ef6c4aff8f6fb64816d238 (diff)
downloadmongo-d4082c855140f25957d9ad9be6b8056413be9d3e.tar.gz
SERVER-69314 Remove featureFlagClusteredIndexes
-rw-r--r--jstests/core/timeseries/clustered_index_options.js6
-rw-r--r--src/mongo/db/catalog/create_collection.cpp14
-rw-r--r--src/mongo/db/commands/create_command.cpp17
-rw-r--r--src/mongo/db/ops/write_ops_exec.cpp7
-rw-r--r--src/mongo/db/storage/storage_parameters.idl5
5 files changed, 8 insertions, 41 deletions
diff --git a/jstests/core/timeseries/clustered_index_options.js b/jstests/core/timeseries/clustered_index_options.js
index c61ee063a85..efd4f221bb1 100644
--- a/jstests/core/timeseries/clustered_index_options.js
+++ b/jstests/core/timeseries/clustered_index_options.js
@@ -44,7 +44,6 @@ res =
assert.eq(options, res.cursor.firstBatch[0].options);
assert.commandWorked(testDB.dropDatabase());
-// Fails with different error code depending on whether featureFlagClusteredIndexes is enabled.
assert.commandFailedWithCode(testDB.createCollection(bucketsCollName, {clusteredIndex: {}}),
[ErrorCodes.TypeMismatch, 40414]);
assert.commandFailedWithCode(testDB.createCollection(bucketsCollName, {clusteredIndex: 'a'}),
@@ -54,16 +53,13 @@ assert.commandFailedWithCode(
{clusteredIndex: true, idIndex: {key: {_id: 1}, name: '_id_'}}),
ErrorCodes.InvalidOptions);
-// Fails with different error code depending on whether featureFlagClusteredIndexes is enabled.
assert.commandFailedWithCode(testDB.createCollection(tsCollName, {clusteredIndex: true}),
[ErrorCodes.InvalidOptions, 5979703]);
assert.commandFailedWithCode(testDB.createCollection('test', {clusteredIndex: true}),
[ErrorCodes.InvalidOptions, 5979703]);
// Using the 'expireAfterSeconds' option on any namespace other than a time-series namespace or a
-// clustered time-series buckets namespace should fail (provdided featureFlagClusteredIndexes is
-// disabled). Otherwise, collection creation must specify the clusteredIndex option to use
-// expireAfterSeconds.
+// clustered time-series buckets namespace should fail.
assert.commandFailedWithCode(testDB.createCollection('test', {expireAfterSeconds: 10}),
ErrorCodes.InvalidOptions);
assert.commandFailedWithCode(testDB.createCollection(bucketsCollName, {expireAfterSeconds: 10}),
diff --git a/src/mongo/db/catalog/create_collection.cpp b/src/mongo/db/catalog/create_collection.cpp
index 69d71d25468..1cd62901fa2 100644
--- a/src/mongo/db/catalog/create_collection.cpp
+++ b/src/mongo/db/catalog/create_collection.cpp
@@ -504,17 +504,6 @@ Status _createCollection(
}
if (auto clusteredIndex = collectionOptions.clusteredIndex) {
- bool clusteredIndexesEnabled =
- feature_flags::gClusteredIndexes.isEnabled(serverGlobalParams.featureCompatibility);
- if (!clusteredIndexesEnabled && !clustered_util::requiresLegacyFormat(nss)) {
- // The 'clusteredIndex' option is only supported in legacy format for specific
- // internal collections when the gClusteredIndexes flag is disabled.
- return Status(ErrorCodes::InvalidOptions,
- str::stream()
- << "The 'clusteredIndex' option is not supported for namespace "
- << nss);
- }
-
if (clustered_util::requiresLegacyFormat(nss) != clusteredIndex->getLegacyFormat()) {
return Status(ErrorCodes::Error(5979703),
"The 'clusteredIndex' legacy format {clusteredIndex: <bool>} is only "
@@ -591,8 +580,7 @@ CollectionOptions clusterByDefaultIfNecessary(const NamespaceString& nss,
if (MONGO_unlikely(clusterAllCollectionsByDefault.shouldFail()) &&
!collectionOptions.isView() && !collectionOptions.clusteredIndex.has_value() &&
(!idIndex || idIndex->isEmpty()) && !collectionOptions.capped &&
- !clustered_util::requiresLegacyFormat(nss) &&
- feature_flags::gClusteredIndexes.isEnabled(serverGlobalParams.featureCompatibility)) {
+ !clustered_util::requiresLegacyFormat(nss)) {
// Capped, clustered collections differ in behavior significantly from normal
// capped collections. Notably, they allow out-of-order insertion.
//
diff --git a/src/mongo/db/commands/create_command.cpp b/src/mongo/db/commands/create_command.cpp
index e3a0e5cbc92..16b3373c399 100644
--- a/src/mongo/db/commands/create_command.cpp
+++ b/src/mongo/db/commands/create_command.cpp
@@ -260,19 +260,10 @@ public:
}
if (cmd.getExpireAfterSeconds()) {
- if (feature_flags::gClusteredIndexes.isEnabled(
- serverGlobalParams.featureCompatibility)) {
- uassert(ErrorCodes::InvalidOptions,
- "'expireAfterSeconds' is only supported on time-series collections or "
- "when the 'clusteredIndex' option is specified",
- cmd.getTimeseries() || cmd.getClusteredIndex());
- } else {
- uassert(ErrorCodes::InvalidOptions,
- "'expireAfterSeconds' is only supported on time-series collections",
- cmd.getTimeseries() ||
- (cmd.getClusteredIndex() &&
- cmd.getNamespace().isTimeseriesBucketsCollection()));
- }
+ uassert(ErrorCodes::InvalidOptions,
+ "'expireAfterSeconds' is only supported on time-series collections or "
+ "when the 'clusteredIndex' option is specified",
+ cmd.getTimeseries() || cmd.getClusteredIndex());
}
// Validate _id index spec and fill in missing fields.
diff --git a/src/mongo/db/ops/write_ops_exec.cpp b/src/mongo/db/ops/write_ops_exec.cpp
index 28848459976..49fb1dd32fb 100644
--- a/src/mongo/db/ops/write_ops_exec.cpp
+++ b/src/mongo/db/ops/write_ops_exec.cpp
@@ -242,11 +242,8 @@ void makeCollection(OperationContext* opCtx, const NamespaceString& ns) {
unsafeCreateCollection(opCtx);
WriteUnitOfWork wuow(opCtx);
CollectionOptions defaultCollectionOptions;
- if (auto fp = globalFailPointRegistry().find("clusterAllCollectionsByDefault"); fp &&
- fp->shouldFail() &&
- feature_flags::gClusteredIndexes.isEnabled(
- serverGlobalParams.featureCompatibility) &&
- !clustered_util::requiresLegacyFormat(ns)) {
+ if (auto fp = globalFailPointRegistry().find("clusterAllCollectionsByDefault");
+ fp && fp->shouldFail() && !clustered_util::requiresLegacyFormat(ns)) {
defaultCollectionOptions.clusteredIndex =
clustered_util::makeDefaultClusteredIdIndex();
}
diff --git a/src/mongo/db/storage/storage_parameters.idl b/src/mongo/db/storage/storage_parameters.idl
index 05dab6e39cc..91e7a937f13 100644
--- a/src/mongo/db/storage/storage_parameters.idl
+++ b/src/mongo/db/storage/storage_parameters.idl
@@ -155,11 +155,6 @@ server_parameters:
default: 16776216 # BSONObjMaxUserSize - 1000
feature_flags:
- featureFlagClusteredIndexes:
- description: "When enabled, support non time-series collections with clustered indexes"
- cpp_varname: feature_flags::gClusteredIndexes
- default: true
- version: 5.3
featureFlagTimeseriesMetricIndexes:
description: "When enabled, support secondary indexes on time-series measurements"
cpp_varname: feature_flags::gTimeseriesMetricIndexes