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

Sharding catalog may be missing databases created via direct connections during/after addShard

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 4.4.25, 7.2.0-rc0, 7.0.2, 5.0.22, 6.0.11, 7.1.0
    • Component/s: Sharding
    • None
    • Catalog and Routing
    • ALL

      The current implementation of addShard discovers/registers databases in the following way:

      1.  listDatabases is invoked on the shard being added
      2. a document is added to config.databases for each result returned by (1)

      If any database is created on the new shard between (1) and (2), the config server will not get to know that it exists. This is totally possible because during addShard users are allowed to use direct connections to the new shard. The same bug can be hit also when users keep on using direct connections instead of switching to the router after addShard returns.

      This can lead to data loss since the first time a router tries to access the version of a non-tracked db it contacts the config server that can potentially register it on another shard.

            Assignee:
            backlog-server-catalog-and-routing [DO NOT USE] Backlog - Catalog and Routing
            Reporter:
            pierlauro.sciarelli@mongodb.com Pierlauro Sciarelli
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated: