[SERVER-1522] replSetInitiate fails if port not explicitly included in host Created: 30/Jul/10  Updated: 12/Jul/16  Resolved: 02/Aug/10

Status: Closed
Project: Core Server
Component/s: Replication
Affects Version/s: 1.5.6
Fix Version/s: 1.5.8

Type: Bug Priority: Major - P3
Reporter: Tony Hannan Assignee: Dwight Merriman
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Participants:

 Description   

1. Start two replica set servers that have not been initiated yet
server> ./mongod --replSet yo/<host>:27018
server> ./mongod --dbpath /data/db2 --port 27018 --replSet yo/<host>

2. Start mongo shell connecting to first server
client> ./mongo <host>/test

3. Initiate replica set without specifying a port on one of the hosts thus assuming default port 27017
client> rs.initiate({ _id: "yo", members: [

{ _id: 0, host: "<host>" }

,

{ _id: 1, host: "<host>:27018" }

] })
{
"assertion" : "need members up to initiate/reconfig, not ok: hannan.vpscustomer.com-1",
"assertionCode" : 13144,
"errmsg" : "db assertion failure",
"ok" : 0
}

Works when port is explicitly given.

Log from first server:
Fri Jul 30 13:31:49 [conn1] replSet replSetInitiate admin command received from client
Fri Jul 30 13:31:49 [conn1] replSet replSetInitiate config object parses ok, 2 members specified
Fri Jul 30 13:31:55 [startReplSets] replSet can't get local.system.replset config from self or any seed (EMPTYCONFIG)
Fri Jul 30 13:31:55 [startReplSets] replSet have you ran replSetInitiate yet?
Fri Jul 30 13:31:55 [startReplSets] replSet sleeping 20sec and will try again.
Fri Jul 30 13:31:59 [conn1] replSet requestHeartbeat hannan.vpscustomer.com-1 : 9001 socket exception
TEMP hb res cfg change:{}
Fri Jul 30 13:31:59 [conn1] replSet replSetInitiate exception: need members up to initiate/reconfig, not ok: <host>-1
Fri Jul 30 13:31:59 [conn1] query admin.$cmd ntoreturn:1 assertion command: { replSetInitiate: { _id: "yo", members: [

{ _id: 0.0, host: "<host>" }

,

{ _id: 1.0, host: "<host>:27018" }

] } } reslen:191 10028ms
Fri Jul 30 13:32:05 [startReplSets] replSet can't get local.system.replset config from self or any seed (EMPTYCONFIG)
Fri Jul 30 13:32:05 [startReplSets] replSet have you ran replSetInitiate yet?
Fri Jul 30 13:32:05 [startReplSets] replSet sleeping 20sec and will try again.



 Comments   
Comment by Tony Hannan [ 03/Aug/10 ]

works now

Comment by Dwight Merriman [ 02/Aug/10 ]

please try now

Generated at Thu Feb 08 02:57:16 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.