[SERVER-1847] ReplicaSet configuration is not yet initialized when the server start to accept connections. Created: 24/Sep/10  Updated: 12/Jul/16  Resolved: 28/Sep/10

Status: Closed
Project: Core Server
Component/s: Replication
Affects Version/s: 1.6.3
Fix Version/s: 1.7.2

Type: Bug Priority: Major - P3
Reporter: Louis Opter Assignee: Kristina Chodorow (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Linux 2.6.34.2 with Ubuntu Lucid Lynx userland, mongodb package from 10genĀ on a dual core 64bits EC2 server. (m1.large)


Attachments: File typescript     File typescript.time    
Operating System: Linux
Participants:

 Description   

Given an empty mongodb server launched with --replSet.

If you immediately run rs.initiate(); when the server start to accept connections on port 27017 the command fails.

A quick look over the source code show that at this time ReplSet::startupStatus is different from ReplSet::EMPTYCONFIG as it should be.

If you wait 5 seconds after the server start to accept connections to run the command then it succeed.

I expect the command to succeed as soon as the server start to accept connections. It breaks automation scripts.

Please find attached the console output.



 Comments   
Comment by auto [ 20/Nov/10 ]

Author:

{'login': 'kchodorow', 'name': 'Kristina Chodorow', 'email': 'kristina@10gen.com'}

Message: set empty config asap on startup SERVER-1847
/mongodb/mongo/commit/3d0d33f1a9545e9292ec63bf2d8ac545c7094378

Comment by Kristina Chodorow (Inactive) [ 28/Sep/10 ]

You should be able to initialize immediately, now.

Comment by auto [ 28/Sep/10 ]

Author:

{'login': 'kchodorow', 'name': 'Kristina Chodorow', 'email': 'kristina@10gen.com'}

Message: set empty config asap on startup SERVER-1847
http://github.com/mongodb/mongo/commit/604d1718284d947c00a641a02053b1c7619a442e

Comment by Louis Opter [ 24/Sep/10 ]

Just realized that in this case rs.initiate fails even after a sleep of 5 seconds.

I will provide a new typescript wich clearly show that it works after a sleep.

Edit: new typescript attached with a sleep of 10 seconds instead of 5.

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