[SERVER-8194] Newly added shards shouldn't get put into the mongos' shard lookup table until after creating a ReplicaSetMonitor for it Created: 16/Jan/13 Updated: 06/Dec/22 Resolved: 19/Apr/18 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Sharding |
| Affects Version/s: | 2.2.2, 2.3.2 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Spencer Brody (Inactive) | Assignee: | [DO NOT USE] Backlog - Sharding Team |
| Resolution: | Done | Votes: | 0 |
| Labels: | revisit | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Assigned Teams: |
Sharding
|
||||||||
| Operating System: | ALL | ||||||||
| Participants: | |||||||||
| Description |
|
This could cause problems in other parts of the code that try to get that replica set's monitor and expect one to exist. The problem appears to be in StaticShardInfo.reload(). If a new shard was added via a different mongos, reload() will put the new shard's information into StaticShardInfo's data structures, _lookup and _rsLookup without creating a ReplicaSetMonitor for it first. Fix would be to check every shard getting added to see if it's connection string is of type SET, and if so call ReplicaSetMonitor::createIfNeeded on it's connection string. |