[SERVER-59330] RSM bootstrap from config server ignores the initial shard name for validation purpose Created: 12/Aug/21  Updated: 29/Oct/23  Resolved: 20/Aug/21

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: 4.4.6
Fix Version/s: 4.4 Required

Type: Bug Priority: Major - P3
Reporter: Andrew Shuvalov (Inactive) Assignee: Andrew Shuvalov (Inactive)
Resolution: Fixed Votes: 0
Labels: sharding-wfbf-day
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Problem/Incident
Related
related to SERVER-59462 Investigate and fix in head if the RS... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Sharding 2021-08-23
Participants:
Case:

 Description   

We have an actual production case when the bootstrap DB got borked by obscure conditions, not excluding manual intervention. As the result the "shards" DB had a correct shard name, but the list of servers pointed to a completely different database's shard, not just non-existing servers.

So the RSM started contacting a completely unrelated cluster that had an actual shard running at the configured address. In theory RSM should check that the shard name matches, but it doesn't. Our code has logic to compare incoming shard name with expected, but this check is not enabled during initial bootstrap. This is the bug to fix.

How this happens? The StreamableReplicaSetMonitor constructor v4.4 creates the _sdamConfig with seed nodes but no shard name.

Next, this config is used by the state machine and TopologyStateMachine::updateRSWithoutPrimary() will hit the check when currentSetName is none, and will proceed with updating the topology description.



 Comments   
Comment by Githook User [ 02/Sep/21 ]

Author:

{'name': 'Andrew Shuvalov', 'email': 'andrew.shuvalov@mongodb.com', 'username': 'shuvalov-mdb'}

Message: SERVER-59462 port of SERVER-59330: fix of RSM bootstrap from config server ignores the initial shard name needed for validation purpose
Branch: master
https://github.com/mongodb/mongo/commit/484225589f343c91fb7b4bac87b66213976c2cb6

Comment by Andrew Shuvalov (Inactive) [ 20/Aug/21 ]

Added SERVER-59462 to investigate the same problem in head.

Comment by Githook User [ 19/Aug/21 ]

Author:

{'name': 'Andrew Shuvalov', 'email': 'andrew.shuvalov@mongodb.com', 'username': 'shuvalov-mdb'}

Message: SERVER-59330: bugfix: StreamableReplicaSetMonitor constructor should bootstrap SdamConfiguration with RS name
Branch: v4.4
https://github.com/mongodb/mongo/commit/0c6300fedd5fa9c074fa4c97f5e4193cd7645593

Generated at Thu Feb 08 05:46:58 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.