Sharding an empty collection releases the critical section too early

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 6.0.0-rc0, 5.0.9
    • Affects Version/s: 5.0.5, 5.1.1, 5.2.1, 5.3.0-rc4
    • Component/s: Sharding
    • None
    • Fully Compatible
    • ALL
    • v5.0
    • Sharding EMEA 2022-04-04, Sharding EMEA 2022-04-18
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      When we shard an empty collection we can take a shortcut and create chunks on shards different from the DB primary. This needs to happen under the critical section so that we don't accept writes to the empty collection, before we have actually told the DB primary to no longer accept unsharded writes.

      The bug that we have is that we release the critical section after we have made the newly sharded collection visible, but before we set the shard version on the DB primary for that collection.

      This means that there is a brief window during which writes for an empty collection that was just sharded could be accepted.

            Assignee:
            Kaloian Manassiev
            Reporter:
            Kaloian Manassiev
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: