[SERVER-66735] addShard should report back an error when adding a new shard with the same replica set name as an existing shard Created: 24/May/22  Updated: 29/Oct/23  Resolved: 26/Sep/22

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

Type: Task Priority: Major - P3
Reporter: Jason Zhang Assignee: Nandini Bhartiya
Resolution: Fixed Votes: 0
Labels: sharding-nyc-subteam1
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Backwards Compatibility: Fully Compatible
Sprint: Sharding 2022-09-19, Sharding 2022-10-03
Participants:
Story Points: 3

 Description   

Currently if we add a new shard with the same replica set name and configuration as an existing shard, addShard does not report that as an error and does a no-op. To give a better user experience, we should give users some indication that an existing shard with the same name/config is already part of the cluster.



 Comments   
Comment by Githook User [ 26/Sep/22 ]

Author:

{'name': 'nandinibhartiyaMDB', 'email': 'nandini.bhartiya@mongodb.com', 'username': 'nandinibhartiyaMDB'}

Message: SERVER-66735: New addShard scenarios
Branch: master
https://github.com/mongodb/mongo/commit/6f6ba115f86fe443359903a5af4ba7ea3c207c9e

Comment by Max Hirschhorn [ 15/Jun/22 ]

Determining whether two connection strings refer to the same replica set is a somewhat involved process. I believe it would require contacting the replica set members in the seed list, reaching a isWritablePrimary=true member, and getting an authoritative list of replica set members. However, I don't think addressing the motivation around SERVER-66735 requires going through all of those lengths.

The goal imo should be that

  • (1) if a user runs the same addShard command a second time (e.g. because there was a transient network error), then the server returns an ok:1 response, and
  • (2) if a user runs an addShard command with the same replica set name but no overlapping replica set members between the existing shard and the command-provided seed list, then the server returns an ok:0 response.
Generated at Thu Feb 08 06:06:17 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.