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

A shard receiving its first chunk should locally drop any indexes not on the donor

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.3.3
    • Affects Version/s: None
    • Component/s: Sharding
    • Labels:
    • Fully Compatible
    • Sharding 2019-12-16, Sharding 2019-12-30, Sharding 2020-01-13

      From the design document:

      When a shard moves away its last chunk, it does not drop the collection or any indexes locally, creating an "orphaned" collection. Mongos will only target the shards that own chunks according to its routing table, so an index on an orphaned collection may become inconsistent with the indexes or collection options on chunk owning shards.

      To handle this, when a non-primary shard receives its first chunk for a collection, it will drop the collection if it exists locally before copying the donor's indexes.

      The primary shard for a collection should always have correct indexes so it must not drop the collection when it receives its first chunk.

      The recipient shard should verify its DatabaseShardingState is up to date before checking if it is the primary shard.

            mihai.andrei@mongodb.com Mihai Andrei
            jack.mulrow@mongodb.com Jack Mulrow
            0 Vote for this issue
            2 Start watching this issue