[SERVER-80532] Sharding catalog may be missing databases created during addShard Created: 29/Aug/23  Updated: 30/Oct/23

Status: Backlog
Project: Core Server
Component/s: Sharding
Affects Version/s: 4.4.25, 7.2.0-rc0, 7.0.2, 5.0.22, 6.0.11, 7.1.0
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Pierlauro Sciarelli Assignee: Backlog - Catalog and Routing
Resolution: Unresolved Votes: 0
Labels: oldshardingemea
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-81285 [For v8.0] Verify that users can't cr... Open
Assigned Teams:
Catalog and Routing
Operating System: ALL
Participants:

 Description   

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.


Generated at Thu Feb 08 06:43:49 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.