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

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

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

      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 Unassigned
            Reporter:
            jordi.serra-torrens@mongodb.com Jordi Serra Torrens
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: