[SERVER-4390] mongos does bad things when adding replica sets with same name as shard Created: 29/Nov/11  Updated: 11/Jul/16  Resolved: 21/Dec/11

Status: Closed
Project: Core Server
Component/s: Replication, Sharding
Affects Version/s: 2.0.1
Fix Version/s: 2.1.0

Type: Bug Priority: Major - P3
Reporter: Greg Studer Assignee: Spencer Brody (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File mongos_weird_names.js    
Issue Links:
Depends
depends on SERVER-4488 Remove mappings from Replica Set name... Closed
Operating System: ALL
Participants:

 Description   

If you add a shard with a name of a replica set which already exists as a shard (and has a different name), the addShard command returns false and no new shard is added, but the existing shard's replica set is strangely replaced by the failing addShard's host.

Should also make sure our other handling of shard vs. replica set names is sane.



 Comments   
Comment by auto [ 21/Dec/11 ]

Author:

{u'login': u'stbrody', u'name': u'Spencer T Brody', u'email': u'spencer@10gen.com'}

Message: Update replica set info on config server by shard name, not replica set name. SERVER-4390.
Branch: master
https://github.com/mongodb/mongo/commit/5827c82fa8992f585dfdf2f766c01bb40f5a218e

Comment by Spencer Brody (Inactive) [ 14/Dec/11 ]

The problem is in config.cpp, the replicaSetChange method. This gets called on every new replica set connection and tries to update the connection string in the config database based on replica set name. This should be changed to look up the shard name for that replica set and do the update by shard name.

Comment by Greg Studer [ 29/Nov/11 ]

Repro'd with 2.0.1, haven't tried with master.

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