[SERVER-7477] Calling rs.initiate() on 2 nodes when setting up replica set results in two primaries Created: 25/Oct/12  Updated: 29/Oct/12  Resolved: 29/Oct/12

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: 2.2.0
Fix Version/s: None

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

Issue Links:
Depends
Duplicate
duplicates SERVER-7366 Create a random seed on rs.initiate()... Closed
Operating System: ALL
Participants:

 Description   
  • Start mongod on 2 nodes
  • login to node1 and call rs.initiate()
  • login to node2 and call rs.initiate() and rs.add('<node1>:<port>')

Now rs.status() shows 2 primaries.

It should probably not allow this, or warn before adding the other node, and require a parameter (force: true), and undo the other rs.initiate().

rs:PRIMARY> rs.status()
{
	"set" : "thomas",
	"date" : ISODate("2012-10-25T22:20:35Z"),
	"myState" : 1,
	"members" : [
		{
			"_id" : 0,
			"name" : "capslock.local:27018",
			"health" : 1,
			"state" : 1,
			"stateStr" : "PRIMARY",
			"uptime" : 50,
			"optime" : Timestamp(1351203632000, 1),
			"optimeDate" : ISODate("2012-10-25T22:20:32Z"),
			"self" : true
		},
		{
			"_id" : 1,
			"name" : "capslock.local:27017",
			"health" : 1,
			"state" : 1,
			"stateStr" : "PRIMARY",
			"uptime" : 3,
			"optime" : Timestamp(1351203598000, 1),
			"optimeDate" : ISODate("2012-10-25T22:19:58Z"),
			"lastHeartbeat" : ISODate("2012-10-25T22:20:34Z"),
			"pingMs" : 0
		}
	],
	"ok" : 1
}



 Comments   
Comment by Eliot Horowitz (Inactive) [ 29/Oct/12 ]

SERVER-7366

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