[SERVER-1415] Giving incorrect parameter syntax to --replSet shows error in log but continues to run. Maybe it should abort like it does if the parameter is missing all together. Also, when parameter is missing, it would be nice to show expected syntax. Created: 13/Jul/10  Updated: 12/Jul/16  Resolved: 29/Jul/10

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

Type: Improvement Priority: Minor - P4
Reporter: Tony Hannan Assignee: Tony Hannan
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

mongodb-linux-x86_64-2010-07-13
version 1.5.5-pre, git version 22653fdefeea36317cbe2557b9cb039e64512ce6


Participants:

 Description   

> bin/mongod --replSet yo

log:
[initandlisten] Tue Jul 13 18:47:45 waiting for connections on port 27017
[startReplSets] Tue Jul 13 18:47:45 replSet caught exception in startReplSets thread: bad --replSet config string format is: <setname>/<seedhost1>,<seedhost2>[,...]
[websvr] Tue Jul 13 18:47:45 web admin interface listening on port 28017



 Comments   
Comment by auto [ 27/Jul/10 ]

Author:

{'login': 'TonyGen', 'name': 'Tony Hannan', 'email': 'tony@10gen.com'}

Message: SERVER-1415: Giving incorrect parameter syntax to --replSet shows error in log but continues to run. Maybe it should abort like it does if the parameter is missing all together.

Parse --replSet parameter into ReplSetCmdline struct in main thread, then fork startReplSets(ReplSetCmdline).

We could not create theReplSet in main thread because constructor waits until config is loaded and thus would halt the rest of startup, and we couldn't move config loading out of constructor because other code tests for theReplSet != 0 to see if config is loaded.
http://github.com/mongodb/mongo/commit/1fc517d53ae9ecd0d02df18a2378e9a6d65ec119

Comment by auto [ 27/Jul/10 ]

Author:

{'login': 'erh', 'name': 'Eliot Horowitz', 'email': 'eliot@10gen.com'}

Message: tony found a bug
Revert "SERVER-1415: Giving incorrect parameter syntax to --replSet shows error in log but continues to run. Maybe it should abort like it does if the parameter is missing all together."

This reverts commit 7740fb4070ad8326c81129d9d9095b556fe5ce13.
http://github.com/mongodb/mongo/commit/6eeeeea25be1944bc667656e6b420639f194f0f9

Comment by auto [ 27/Jul/10 ]

Author:

{'login': 'erh', 'name': 'Eliot Horowitz', 'email': 'eliot@10gen.com'}

Message: SERVER-1415: Giving incorrect parameter syntax to --replSet shows error in log but continues to run. Maybe it should abort like it does if the parameter is missing all together.

Per Eliot's suggestion, instead of calling dbexit in startReplSets thread. Create theReplSet object in main thread, which checks and parses --replSet parameter, then just call its go() methon in startReplSets thread.

Conflicts:

db/repl/rs.cpp
http://github.com/mongodb/mongo/commit/7740fb4070ad8326c81129d9d9095b556fe5ce13

Comment by Eliot Horowitz (Inactive) [ 23/Jul/10 ]

we only close once something is approved and released

Comment by Tony Hannan [ 23/Jul/10 ]

dbexit on malformed --replSet parameter

Comment by Dwight Merriman [ 14/Jul/10 ]

agree.

btw it is showing the expected syntax already.

want to try to do this (make it shut down)? see main() in db/db.cpp

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