-
Type: Improvement
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
Minor Change
-
Sharding EMEA 2022-02-21, Sharding EMEA 2022-03-07
Before to create a sharded collection it is currently required to invoke the enableSharding command. This command doesn't really do much apart from setting a flag in config.databases, that is only consumed by the shardCollection command.
This additional step is not very useful and not really required in order to create a sharded collection, additionally it contributes to make the sharding experience more complicated than than the replica set one without any real benefit.
This ticket contain a proposal to make the enableSharding command optional and to deprecate it.
Proposal:
- It won't be necessary anymore to call enableSharding before to shard a collection.
- We will still keep support for enableSharding command because users are using it to select the database primaryShard before to create a collection. So enableSharding will really behave like a "createDatabase" that you can use if you want to create a database with specific options, otherwise default options will be chosen automatically on the implicit creation (like the primarShard).
Additionally the name "enableSharding" will become misleading since it won't really "enable sharding" anymore, so we will introduce a new createDatabase command as an alias of the old enableSharding. In this sense the new createDatabase command will be very similar to createCollection , it will be optional but you can use it to specify particular options for database creation.
(We decided to postpone the aliasing for now)
- causes
-
SERVER-63983 Remove deprecated enableSharding flag
- Closed
- depends on
-
SERVER-63897 IDL-ify DatabaseType
- Closed
- is depended on by
-
SERVER-64045 Remove partitioned field from DatabaseType constructor
- Closed
-
SERVER-65798 Remove enableShardingOptional feature flag
- Closed
-
SERVER-74998 Remove deprecated enable_sharding parameter from ShardedCluster fixture
- Closed
- is duplicated by
-
SERVER-4773 Could shardcollection implicity enablesharding on the database?
- Closed
- related to
-
SERVER-79893 6.0.x Enterprise Advanced: sharded databases always shows "partitioned: false"
- Closed
-
SERVER-76287 Rename enableSharding command to createDatabase
- Blocked