shardCollection does not serialise with concurrent unsharded creations

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Won't Fix
    • Priority: Major - P3
    • None
    • Affects Version/s: 5.0.0, 6.0.0
    • Component/s: None
    • Catalog and Routing
    • ALL
    • v6.0
    • CAR Team 2025-02-03
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      It has been observed that the shardCollection command does not serialize with concurrent creations in v6.0 and below. As a consequence, the unsharded collection might get sharded with invalid options, such as  { capped: true }.

      In master, the 2 operations would not run concurrently as both the operation serialize on the metadata critical section. However, in 6.0 the storage create does not serialize on the critical section (introduce starting from v6.1 SERVER-67633)
      In case a create succeeds in between the last check of the coordinators (which prevents from sharding capped collection) and the actual creation (which is performed indirectly via createIndex) the coordinator will:

      • create the index on the capped collection (and skip the collection creation as it already exists)
      • shard the capped collection

              Assignee:
              Enrico Golfieri
              Reporter:
              Enrico Golfieri
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

                Created:
                Updated:
                Resolved: