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

Sharding an empty collection releases the critical section too early

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • 5.0.5, 5.1.1, 5.2.1, 5.3.0-rc4
    • 6.0.0-rc0, 5.0.9
    • Sharding
    • None
    • Fully Compatible
    • ALL
    • v5.0
    • Sharding EMEA 2022-04-04, Sharding EMEA 2022-04-18

    Description

      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.

      Attachments

        Activity

          People

            kaloian.manassiev@mongodb.com Kaloian Manassiev
            kaloian.manassiev@mongodb.com Kaloian Manassiev
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: