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

Collection drop doesn't clean the shard version on empty shards

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Sharding
    • Labels:
      None
    • Operating System:
      ALL
    • Steps To Reproduce:
      Hide

      Run attached js script.

      Show
      Run attached js script.
    • Linked BF Score:
      0

      Description

      In a sharded collection, if all chunks on the primary shard has been migrated to non-primary shards, collection drop command on mongos will not send "drop" command to the empty primary shard, but set its shard version to unsharded/dropped state 0|0||0000... However, an empty shard has the shard version 0|0||epoch and thinks the new shard version is compatible with its current one, so the empty shard doesn't drop its metadata.

      In this situation, another insert and query to the just dropped (now unsharded) collection will go to the primary that has stale metadata. The inserted doc will be skipped because the shard doesn't think this doc belongs to it (it thinks it's empty) based on its stale metadata.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              renctan Randolph Tan
              Reporter:
              siyuan.zhou Siyuan Zhou
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: