[SERVER-74311] Add sanity check assertions that only a config server has config shard identity Created: 23/Feb/23  Updated: 29/Oct/23  Resolved: 14/Mar/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 7.0.0-rc0

Type: Task Priority: Major - P3
Reporter: Jack Mulrow Assignee: Wenqin Ye
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by SERVER-74663 Transitioning a server from configsvr... Closed
Backwards Compatibility: Fully Compatible
Sprint: Sharding NYC 2023-03-06, Sharding NYC 2023-03-20
Participants:

 Description   

As of SERVER-73865 the config server will have a shard identity document with "config" as its shard name. We reject adding a shard with that name if not using the transitionToCatalogShard command on the config server, but we should still have validation when inserting and loading the shard identity document to avoid problems from manual intervention.

In particular:

  • When inserting a shard identity document, we should uassert (likely in the ShardServerOpObserver) that if the name is "config," the local node must have the config role, and if the name is not, it must not have the config role
  • When loading the shard identity document, we should uassert using the same logic (possibly when initializing from the shard identity), ie only allow "config" name on a config role node and require there is no config role for any other name


 Comments   
Comment by Githook User [ 14/Mar/23 ]

Author:

{'name': 'wenqinYe', 'email': 'wenqin908@gmail.com', 'username': 'wenqinYe'}

Message: SERVER-74311: Add sanity check assertions that only a config server has config shard identity
Branch: master
https://github.com/mongodb/mongo/commit/14aab7104cf4c5a7a8b195119e1d693008ee2044

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