[SERVER-60926] Make enableSharding command optional Created: 22/Oct/21  Updated: 29/Oct/23  Resolved: 28/Feb/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 6.0.0-rc0

Type: Improvement Priority: Major - P3
Reporter: Tommaso Tocci Assignee: Tommaso Tocci
Resolution: Fixed Votes: 0
Labels: shardingemea-qw
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-63897 IDL-ify DatabaseType Closed
is depended on by SERVER-64045 Remove partitioned field from Databas... Closed
is depended on by SERVER-65798 Remove enableShardingOptional feature... Closed
is depended on by SERVER-74998 Remove deprecated enable_sharding par... Closed
Documented
is documented by DOCS-15138 [Server] Investigate changes in SERVE... Closed
Duplicate
is duplicated by SERVER-4773 Could shardcollection implicity enabl... Closed
Problem/Incident
causes SERVER-63983 Remove deprecated enableSharding flag Closed
Related
related to SERVER-79893 6.0.x Enterprise Advanced: sharded da... Closed
related to SERVER-76287 Rename enableSharding command to crea... Blocked
Backwards Compatibility: Minor Change
Sprint: Sharding EMEA 2022-02-21, Sharding EMEA 2022-03-07
Participants:

 Description   

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)


 Comments   
Comment by Githook User [ 08/Mar/22 ]

Author:

{'name': 'Frederic Vitzikam (fredvitz)', 'email': '95658478+fredvitz@users.noreply.github.com', 'username': 'fredvitz'}

Message: REP-157 Fix TestInitializeCollections_EnableShardingAndShardCollection (#143)

SERVER-60926 changed server behavior to accept ShardCollection even without previous EnableSharding, updated the test accordingly.
Branch: fredvitz/REP-237
https://github.com/10gen/mongosync/commit/907dee6983533c529936cfc86e8005090a56d982

Comment by Githook User [ 08/Mar/22 ]

Author:

{'name': 'Frederic Vitzikam (fredvitz)', 'email': '95658478+fredvitz@users.noreply.github.com', 'username': 'fredvitz'}

Message: REP-157 Fix TestInitializeCollections_EnableShardingAndShardCollection (#143)

SERVER-60926 changed server behavior to accept ShardCollection even without previous EnableSharding, updated the test accordingly.
Branch: ali-mir/REP-265
https://github.com/10gen/mongosync/commit/907dee6983533c529936cfc86e8005090a56d982

Comment by Tommaso Tocci [ 07/Mar/22 ]

massimiliano.marcon starting from 6.0 we can't rely anymore on the `partitioned` field in `config.databases`. So if you have any code in mongosh that uses this field you should change it accordingly.

Comment by Githook User [ 03/Mar/22 ]

Author:

{'name': 'Frederic Vitzikam (fredvitz)', 'email': '95658478+fredvitz@users.noreply.github.com', 'username': 'fredvitz'}

Message: REP-157 Fix TestInitializeCollections_EnableShardingAndShardCollection (#143)

SERVER-60926 changed server behavior to accept ShardCollection even without previous EnableSharding, updated the test accordingly.
Branch: main
https://github.com/10gen/mongosync/commit/907dee6983533c529936cfc86e8005090a56d982

Comment by Githook User [ 28/Feb/22 ]

Author:

{'name': 'Tommaso Tocci', 'email': 'tommaso.tocci@mongodb.com', 'username': 'toto-dev'}

Message: SERVER-60926 Make enableSharding command optional
Branch: master
https://github.com/mongodb/mongo/commit/891c15831552cea487545c0b16944a7a195d6871

Generated at Thu Feb 08 05:51:06 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.