Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-60926

Make enableSharding command optional

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 6.0.0-rc0
    • 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)

            Assignee:
            tommaso.tocci@mongodb.com Tommaso Tocci
            Reporter:
            tommaso.tocci@mongodb.com Tommaso Tocci
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: