[SERVER-3740] Supplying --fastsync with --master silently locks server Created: 01/Sep/11  Updated: 06/Dec/22  Resolved: 08/Feb/18

Status: Closed
Project: Core Server
Component/s: Replication
Affects Version/s: 2.0.0-rc0
Fix Version/s: None

Type: Bug Priority: Minor - P4
Reporter: Lee Johnson Assignee: Backlog - Replication Team
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

linux-x86_64


Assigned Teams:
Replication
Operating System: ALL
Participants:

 Description   

mongod will start with --fastsync and --master, despite these options being a contradiction. The server will then silently not accept any connections - the logs show it having stopped at "no journal files present, no recovery needed". Supplying --fastsync and --master should error out with a message that these arguments are mutually exclusive.

db version v2.0.0-rc0, pdfile version 4.5
Thu Sep 1 14:41:28 git version: 8d4bf50111352cee5a4f1abf25b63442d6c45dc4

==== Example ====

/tmp/mongodb-linux-x86_64-2.0.0-rc0/bin > pgrep -lf mongo
17541 ./mongod --master --fastsync --dbpath /tmp/ --fork --logpath /tmp/md.log

/tmp/mongodb-linux-x86_64-2.0.0-rc0/bin > cat /tmp/md.log
Thu Sep 1 14:59:34 [initandlisten] MongoDB starting : pid=17630 port=27017 dbpath=/tmp/ master=1 64-bit host=XXXXXXXX
Thu Sep 1 14:59:34 [initandlisten] db version v2.0.0-rc0, pdfile version 4.5
Thu Sep 1 14:59:34 [initandlisten] git version: 8d4bf50111352cee5a4f1abf25b63442d6c45dc4
Thu Sep 1 14:59:34 [initandlisten] build info: Linux bs-linux64.10gen.cc 2.6.21.7-2.ec2.v1.2.fc8xen #1 SMP Fri Nov 20 17:48:28 EST 2009 x86_64 BOOST_LIB_VERSION=1_41
Thu Sep 1 14:59:34 [initandlisten] options:

{ dbpath: "/tmp/", fastsync: true, fork: true, logpath: "/tmp/md.log", master: true }

Thu Sep 1 14:59:34 [initandlisten] journal dir=/tmp/journal
Thu Sep 1 14:59:34 [initandlisten] recover : no journal files present, no recovery needed

/tmp/mongodb-linux-x86_64-2.0.0-rc0/bin > ./mongo
MongoDB shell version: 2.0.0-rc0
connecting to: test
Thu Sep 1 14:58:38 Error: couldn't connect to server 127.0.0.1 shell/mongo.js:84
exception: connect failed

/tmp/mongodb-linux-x86_64-2.0.0-rc0/bin > pkill mongo

/tmp/mongodb-linux-x86_64-2.0.0-rc0/bin > ./mongod --master --dbpath /tmp/ --fork --logpath /tmp/md.log
forked process: 17604
all output going to: /tmp/md.log

/tmp/mongodb-linux-x86_64-2.0.0-rc0/bin > cat /tmp/md.log
Thu Sep 1 15:00:00 [initandlisten] MongoDB starting : pid=17659 port=27017 dbpath=/tmp/ master=1 64-bit host=XXXXXXX
Thu Sep 1 15:00:00 [initandlisten] db version v2.0.0-rc0, pdfile version 4.5
Thu Sep 1 15:00:00 [initandlisten] git version: 8d4bf50111352cee5a4f1abf25b63442d6c45dc4
Thu Sep 1 15:00:00 [initandlisten] build info: Linux bs-linux64.10gen.cc 2.6.21.7-2.ec2.v1.2.fc8xen #1 SMP Fri Nov 20 17:48:28 EST 2009 x86_64 BOOST_LIB_VERSION=1_41
Thu Sep 1 15:00:00 [initandlisten] options:

{ dbpath: "/tmp/", fork: true, logpath: "/tmp/md.log", master: true }

Thu Sep 1 15:00:00 [initandlisten] journal dir=/tmp/journal
Thu Sep 1 15:00:00 [initandlisten] recover : no journal files present, no recovery needed
Thu Sep 1 15:00:00 [initandlisten] waiting for connections on port 27017
Thu Sep 1 15:00:00 [websvr] admin web console waiting for connections on port 28017

/tmp/mongodb-linux-x86_64-2.0.0-rc0/bin > ./mongo
MongoDB shell version: 2.0.0-rc0
connecting to: test
>
bye



 Comments   
Comment by Gregory McKeon (Inactive) [ 08/Feb/18 ]

As of 3.6, master/slave is deprecated, so we won't be fixing this.

Comment by Eliot Horowitz (Inactive) [ 17/Jan/13 ]

We should only allow --fastsync with --slave.
--master or --replSet should make it quit immediately.

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