Calling `shardCollection` after `enableSharding` from a different MongoS is not causally consistent

XMLWordPrintableJSON

    • Fully Compatible
    • ALL
    • v5.0
    • Sharding EMEA 2021-07-26
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      The enableSharding operation just enables the sharded:true bit on the entry for a specific database, but doesn't bump the database version, nor involves the database primary. This means that calling enableSharding from one MongoS and then performing shardCollection through another may cause the DB Primary executing the shardCollection procedure to not see the field enabled and fail the operation.

      This used to work when shardCollection executed on the config server, because it was always the primary, but now that it runs on the DB Primary, this is no longer guaranteed.

              Assignee:
              Pierlauro Sciarelli
              Reporter:
              Kaloian Manassiev
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: