[SERVER-2514] MongoD started with --fork crashes when initiating a replica set Created: 10/Feb/11  Updated: 12/Jul/16  Resolved: 12/Feb/11

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: 1.7.5
Fix Version/s: 1.7.6

Type: Bug Priority: Major - P3
Reporter: Brendan W. McAdams Assignee: Eliot Horowitz (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Mac OS 10.6.6 , 64 bit MongoDB 1.7.5


Attachments: Text File test1.log     Text File test2.log    
Operating System: OS X
Participants:

 Description   

Started up 2 local mongodb instances on my laptop, they work fine to initiate a replica set if started in the foreground.

However, if I start them with --fork, upon initiating the replica set the mongod instance I was connected to when initiating crashes with:

Wed Feb 9 19:11:43 [conn2] replSet replSetInitiate all members seem up
Wed Feb 9 19:11:43 [conn2] ******
Wed Feb 9 19:11:43 [conn2] creating replication oplog of size: 183MB...
Wed Feb 9 19:11:43 Got signal: 6 (Abort trap).

Wed Feb 9 19:11:43 Backtrace:
0x100430573 0x7fff819c567a 0x7fff5fbfdb20 0x10042b27d 0x10043135b 0x100431a54 0x100433134 0x1000014f4 0xa
0 mongod 0x0000000100430573 _ZN5mongo10abruptQuitEi + 339
1 libSystem.B.dylib 0x00007fff819c567a _sigtramp + 26
2 ??? 0x00007fff5fbfdb20 0x0 + 140734799797024
3 mongod 0x000000010042b27d _ZN5mongo6listenEi + 205
4 mongod 0x000000010043135b _ZN5mongo14_initAndListenEiPKc + 1723
5 mongod 0x0000000100431a54 _ZN5mongo13initAndListenEiPKc + 36
6 mongod 0x0000000100433134 main + 3780
7 mongod 0x00000001000014f4 start + 52
8 ??? 0x000000000000000a 0x0 + 10

Startup commands for mongod are

mongod --port 27018 --replSet test --logpath test1.log --dbpath rs1 --fork
mongod --port 27019 --replSet test --logpath test2.log --dbpath rs2 --fork

Replica set config

{
"_id" : "test",
"members" : [

{ "_id" : 0, "host" : "localhost:27018" }

,

{ "_id" : 1, "host" : "localhost:27019" }

]
}

The shell session looks like this:

> rs.initiate(config)
Wed Feb 9 19:11:43 DBClientCursor::init call() failed
Wed Feb 9 19:11:43 query failed : admin.$cmd { replSetInitiate: { _id: "test", members: [

{ _id: 0.0, host: "localhost:27018" }

,

{ _id: 1.0, host: "localhost:27019" }

] } } to: 127.0.0.1:27018
Wed Feb 9 19:11:43 Error: error doing query: failed shell/collection.js:150
Wed Feb 9 19:11:43 trying reconnect to 127.0.0.1:27018
Wed Feb 9 19:11:43 reconnect 127.0.0.1:27018 failed couldn't connect to server 127.0.0.1:27018

Log file attached for both servers.

This does not occur when --fork is not used.



 Comments   
Comment by auto [ 12/Feb/11 ]

Author:

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

Message: need to run unit tests after fork so system state is stable SERVER-2514
https://github.com/mongodb/mongo/commit/0196f0159e6ef5aab44429ba28c832228d543932

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