Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-15138

[Server] Investigate changes in SERVER-60926: Make enableSharding command optional

      Original Downstream Change Summary

      Starting from FCV 6.0 all databases will be considered sharding-enabled by default, meaning that it won't be necessary to call `enableSharding` on a database before to shard a collection (through `shardCollection`) in that database.

      Additionally starting from FCV 6.0 `shardCollection` will automatically create the database if doesn't exists, this means that starting from FCV 6.0 it won't never throw NamespacesNotFound.

      Description of Linked Ticket

      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.

            Assignee:
            kenneth.dyer@mongodb.com Kenneth Dyer
            Reporter:
            backlog-server-pm Backlog - Core Eng Program Management Team
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              1 year, 49 weeks, 4 days ago