summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Graetzer <simon.gratzer@mongodb.com>2021-09-22 13:21:39 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-09-22 13:49:38 +0000
commit9eccc4ff68b55b32d5eb9232b18a5a073effe41c (patch)
tree6823d8bdf14edf26bd51d0c1eee7d047d46dcaa6
parent28fa5831f7b8e7b6ca1ea84fc7bcc7389b2a0ea4 (diff)
downloadmongo-9eccc4ff68b55b32d5eb9232b18a5a073effe41c.tar.gz
SERVER-60074 Add feature flag for configureCollectionAutoSplitter command
-rw-r--r--jstests/sharding/autosplit_configure_collection.js3
-rw-r--r--src/mongo/db/s/config/configsvr_configure_collection_auto_split.cpp5
-rw-r--r--src/mongo/s/catalog/type_collection.h2
-rw-r--r--src/mongo/s/catalog/type_collection.idl2
-rw-r--r--src/mongo/s/request_types/configure_collection_auto_split.idl6
5 files changed, 15 insertions, 3 deletions
diff --git a/jstests/sharding/autosplit_configure_collection.js b/jstests/sharding/autosplit_configure_collection.js
index bd252c5e0b4..496b4a88c02 100644
--- a/jstests/sharding/autosplit_configure_collection.js
+++ b/jstests/sharding/autosplit_configure_collection.js
@@ -3,7 +3,8 @@
* due to data insertion.
*
* @tags: [
- * requires_fcv_51
+ * requires_fcv_51,
+ * featureFlagPerCollectionAutoSplitter,
* ]
*/
(function() {
diff --git a/src/mongo/db/s/config/configsvr_configure_collection_auto_split.cpp b/src/mongo/db/s/config/configsvr_configure_collection_auto_split.cpp
index 6286ae55baf..a27a84b141d 100644
--- a/src/mongo/db/s/config/configsvr_configure_collection_auto_split.cpp
+++ b/src/mongo/db/s/config/configsvr_configure_collection_auto_split.cpp
@@ -64,6 +64,11 @@ public:
str::stream() << Request::kCommandName << " can only be run on config servers",
serverGlobalParams.clusterRole == ClusterRole::ConfigServer);
+ uassert(8423309,
+ "_configsvrConfigureAutoSplit command not supported",
+ mongo::feature_flags::gShardingPerCollectionAutoSplitter.isEnabled(
+ serverGlobalParams.featureCompatibility));
+
const NamespaceString& nss = ns();
uassert(ErrorCodes::InvalidNamespace,
diff --git a/src/mongo/s/catalog/type_collection.h b/src/mongo/s/catalog/type_collection.h
index a903da4d224..fb032a94f72 100644
--- a/src/mongo/s/catalog/type_collection.h
+++ b/src/mongo/s/catalog/type_collection.h
@@ -145,7 +145,7 @@ public:
void setMaxChunkSizeBytes(int64_t value);
bool getAllowAutoSplit() const {
- return !getNoAutoSplit();
+ return !getNoAutoSplit().get_value_or(false);
}
bool getAllowBalance() const {
diff --git a/src/mongo/s/catalog/type_collection.idl b/src/mongo/s/catalog/type_collection.idl
index 10612997ec8..acff4f93d88 100644
--- a/src/mongo/s/catalog/type_collection.idl
+++ b/src/mongo/s/catalog/type_collection.idl
@@ -113,7 +113,7 @@ structs:
noAutoSplit:
type: bool
description: "Specifies whether the auto-splitter should be running or not for this collection."
- default: false
+ optional: true
noBalance:
type: bool
description: "Consulted by the Balancer only and indicates whether this collection
diff --git a/src/mongo/s/request_types/configure_collection_auto_split.idl b/src/mongo/s/request_types/configure_collection_auto_split.idl
index 0a3121d8256..f4ccc578ff0 100644
--- a/src/mongo/s/request_types/configure_collection_auto_split.idl
+++ b/src/mongo/s/request_types/configure_collection_auto_split.idl
@@ -34,6 +34,12 @@ global:
imports:
- "mongo/idl/basic_types.idl"
+feature_flags:
+ featureFlagPerCollectionAutoSplitter:
+ description: "Add capability to configure per collection auto-splitter settings."
+ cpp_varname: feature_flags::gShardingPerCollectionAutoSplitter
+ default: false
+
structs:
configure_auto_split_params:
description: "Parameters for configureCollectionAutoSplitter command"