[SERVER-4189] "can't find self in new replset config" error when trying to run multiple mongod processes on the same machine Created: 02/Nov/11  Updated: 29/Feb/12  Resolved: 21/Jan/12

Status: Closed
Project: Core Server
Component/s: Usability
Affects Version/s: 1.8.4, 2.0.1
Fix Version/s: None

Type: Bug Priority: Minor - P4
Reporter: Paul D. Walker Assignee: Mathias Stearn
Resolution: Won't Fix Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

ubuntu linux 10.04.03, stock 1.8.4 debian build from the 10gen repository


Issue Links:
Depends
Operating System: ALL
Participants:

 Description   

If I have a machine with multiple IPs, and I bind a mongod to each ip, I am unable to add the daemons to a replicate set. Attemtps to do a rs.add() or rs.addArb() fails with the "can't find self in new replset config" assertion error.

Three test cases: (assume the mongo data directories are cleaned out before running the test)

Case 1 - success, expected
mongod1: ip1, port 27017
mongod2: ip1, port 27018
mongod3: ip1, port 27019

mongod1:
rs.initiate() -> success
rs.add("ip1:27018") -> success
rs.addArb("ip1:27019") -> success

Case 2 - success, expected
mongod1: ip1, 27017
mongod2: ip2, 27018
mongod3: ip3, 27019

mongod1:
rs.initiate() -> success
rs.add("ip2:27018") -> success
rs.addArb("ip3:27019") -> success

Case 3 failure - unexpected
mongod1: ip1, port 27017
mongod2: ip2, port 27017
mongod3: ip3, port 27017

mongod1:
rs.initiate() -> success
rs.add("ip2:27017") -> failure
rs.addArb("ip3:27017") -> failure

error message

{
"assertion" : "can't find self in new replset config",
"assertionCode" : 13433,
"errmsg" : "db assertion failure",
"ok" : 0
}

The error message is found in db/repl/rs_config.cpp 2.0.1 1.8.4



 Comments   
Comment by Mathias Stearn [ 21/Jan/12 ]

We assume that on any given host the port will uniquely identify a mongod. If you want to run more than one mongod on a machine you must give them different ports or use VMs.

Comment by Paul D. Walker [ 19/Nov/11 ]

Well, yes, of course that is possible.

Just the same, this is clearly a bug as there is no reason why I should not be allowed to bind a the daemons to different ips but the same port.

Is there a valid reason why this should not be possible?

Comment by Mathias Stearn [ 18/Nov/11 ]

I would suggest using different ports rather than using --bind to bind to the same port on different addresses.

Comment by Paul D. Walker [ 02/Nov/11 ]

The error message got eaten.

 
pdw:PRIMARY> rs.add('10.10.10.12:27017')
{
	"assertion" : "can't find self in new replset config",
	"assertionCode" : 13433,
	"errmsg" : "db assertion failure",
	"ok" : 0
}

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