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

crash in C++ client driver during shutdowing primary mongo server from repset

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Critical - P2 Critical - P2
    • 2.0.5, 2.1.1
    • Affects Version/s: 2.0.2, 2.0.4
    • Component/s: Internal Client
    • Labels:
      None
    • Environment:
      CentOS 6
      server 2.0.4
      C++ client 2.0.2-pre
    • Linux

      I was testing stability of my client which used mongo server and client was crashed in mongo C++ client driver at moment of shutdowing primary mongo server.
      This crash is reproduced every time. See guide below

      Here is stack trace of crash:
      #0 0x0830d98d in mongo::DBClientCursor::peekError(mongo::BSONObj*) ()
      #1 0x08313f6b in mongo::DBClientReplicaSet::checkSlaveQueryResult(std::auto_ptr<mongo::DBClientCursor>) ()
      #2 0x08313a3c in mongo::DBClientReplicaSet::query(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, mongo::Query, int, int, mongo::BSONObj const*, int, int) ()

      Guide to reproduce this:

      Make replicaSet configuration like this:
      PRIMARY> rs.conf()
      {
      "_id" : "wop_test",
      "version" : 15,
      "members" : [

      { "_id" : 0, "host" : "10.68.11.136:27017", "priority" : 26 }

      ,

      { "_id" : 1, "host" : "10.68.11.138:27017", "votes" : 0, "priority" : 0 }

      ,

      { "_id" : 2, "host" : "10.68.11.138:27018", "votes" : 0, "priority" : 0 }

      ]
      }

      Shutdown server #1 and #2 (which have no votes)

      Then shutdown last standing primary #0 and immediately make request from client.
      If request will be doing a few seconds after shutdowning #0, client will be handle it correct (throw exception)

      May be it because I use old C++ client 2.0.2-pre with server 2.0.4 ?

            Assignee:
            randolph@mongodb.com Randolph Tan
            Reporter:
            magum Alexander Borodetsky
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: