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

addShard upserts discovered databases without locking, this could change a databases primary out from under it

    • Type: Icon: Bug Bug
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Sharding
    • Labels:
    • Sharding
    • ALL

      During addShard we find any databases that already exist on the shard being added and attempt to add them to the cluster. Before we do that, we check that no databases that exist on the shard already exist on the cluster. There is no locking during these checks, however, so it's possible that a database could be created after the check and assigned to a different shard. If that happens, when we upsert the database document for the database discovered on the shard, we might wind up changing the 'primary' shard for that database out from under it, leading to data loss.

            Assignee:
            backlog-server-sharding [DO NOT USE] Backlog - Sharding Team
            Reporter:
            spencer@mongodb.com Spencer Brody (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: