Create tracked/sharded collection can commit with chunks belonging to a shard that was just removed

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Duplicate
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Catalog and Routing
    • ALL
    • Show
      repro.js
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      CreateCollectionCoordinator first chooses the shards that will own chunks and later [commits the metadata to the configsvr|https://github.com/mongodb/mongo/blob/ac8dae158c37de49c03c4139649f775adf888c8d/src/mongo/db/s/create_collection_coordinator.cpp#L1597-L1605. By the time we commit, one of the shards where we place chunks might have been removed. If that happens, some config.chunks documents will point to a shardId that is no longer part of the cluster. This results in:

      • The ShardingDDLCoordinator never completing because [this routing table refresh|https://github.com/mongodb/mongo/blob/ac8dae158c37de49c03c4139649f775adf888c8d/src/mongo/db/s/create_collection_coordinator.cpp#L1928-L1929 fails repeatedly.
      • Routers see the new collection exists (has been committed), but are unable to write to it.

            Assignee:
            Unassigned
            Reporter:
            Jordi Serra Torrens
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: