Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-2514

MongoD started with --fork crashes when initiating a replica set

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.7.6
    • Affects Version/s: 1.7.5
    • Component/s: None
    • Labels:
      None
    • Environment:
      Mac OS 10.6.6 , 64 bit MongoDB 1.7.5
    • OS X

      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.

        1. test1.log
          4 kB
        2. test2.log
          4 kB

            Assignee:
            eliot Eliot Horowitz (Inactive)
            Reporter:
            brendan Brendan W. McAdams
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: