[SERVER-14683] starting server with wrong replSet doesn't refuse Created: 25/Jul/14  Updated: 06/Nov/14  Resolved: 06/Nov/14

Status: Closed
Project: Core Server
Component/s: Replication
Affects Version/s: 2.4.8, 2.6.3
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Asya Kamsky Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-15689 Poor error message when replica set n... Closed
Backwards Compatibility: Minor Change
Operating System: ALL
Participants:

 Description   

I had a server member of replSet asyaRS.

I restarted the mongod with --replSet NotAsya and it happily came up and identified itself as member of asyaRS (since local already had the repl set config there).

It would be safer if we instead complained about replSet argument on command line not matching the stored one.

> rs.conf()._id
asyaRS
> rs.status().set
asyaRS
> db.serverCmdLineOpts().parsed.replication
{ "replSet" : "NotAsya" }



 Comments   
Comment by Scott Hernandez (Inactive) [ 06/Nov/14 ]

With the refactor in 2.7.x this will now error, and go into the removed state:

2014-11-06T12:57:07.496-0500 W REPLSETS [ReplicationExecutor] Local replica set configuration document reports set name of test7, but command line reports test71; waitng for reconfig or remote heartbeat
2014-11-06T12:57:07.497-0500 I REPLSETS [ReplicationExecutor] transition to REMOVED

Comment by Scott Hernandez (Inactive) [ 25/Jul/14 ]

I tested with 2.2/2.4 and this behaves the same way. However 2.0 and before will read configs by the name and fail if the name doesn't have a matching config document. Post 2.0 we don't allow more than one config in local.system.replset and seem to have changed the code to load the first doc and not validate the matching name.

I'd be inclined to treat this as a regression.

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