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

shardCollection does not serialise with concurrent unsharded creations

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 5.0.0, 6.0.0
    • Component/s: None
    • Catalog and Routing
    • ALL
    • v6.0

      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:
            Unassigned Unassigned
            Reporter:
            enrico.golfieri@mongodb.com Enrico Golfieri
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated: