[SERVER-1519] rs.initiate() generates bad config: all host _id's are 0 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
Environment:

db version v1.5.7-pre-, pdfile version 4.5
git version: db8bd901d8be3eaeabc3a25646c3deb56e523d6d


Operating System: ALL
Participants:

 Description   

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

2. Start mongo shell connecting to one of them
client> ./mongo <host>/test

3. Initiate replica set using default config
client> rs.initiate()
{
"info2" : "no configuration explicitly specified – making one",
"assertion" : "can't find self in the replset config",
"assertionCode" : 13279,
"errmsg" : "db assertion failure",
"ok" : 0
}

In server1 log below, notice that generated configuration has _id 0 for both hosts. That is the problem. It works when you supply the config explicitly with unique host _ids.

Fri Jul 30 12:12:34 [conn3] replSet replSetInitiate admin command received from client
Fri Jul 30 12:12:34 [conn3] replSet info initiate : no configuration specified. Using a default configuration for the set
Fri Jul 30 12:12:34 [conn3] replSet created this configuration for initiation : { _id: "yo", members: [

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

,

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

] }
Fri Jul 30 12:12:34 [conn3] replSet replSetInitiate config object parses ok, 1 members specified
Fri Jul 30 12:12:34 [conn3] replSet replSetInitiate exception: can't find self in the replset config
Fri Jul 30 12:12:36 [startReplSets] replSet can't get local.system.replset config from self or any seed (EMPTYCONFIG)
Fri Jul 30 12:12:36 [startReplSets] replSet have you ran replSetInitiate yet?
Fri Jul 30 12:12:36 [startReplSets] replSet sleeping 20sec and will try again.



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

works now

Comment by auto [ 02/Aug/10 ]

Author:

{'login': 'dwight', 'name': 'Dwight', 'email': 'dwight@10gen.com'}

Message: rs SERVER-1519
http://github.com/mongodb/mongo/commit/5c9384185838ed68282079688439f883cac31bbb

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