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

Update call causes mongod to crash

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Write Ops
    • ALL
    • Hide

      From SERVER-6835:

      use test
      db.repro.update({"_id.shardKey": 1, "_id": {shardKey: 1, uniquifier: 1}}, { $setOnInsert: { payload: 1 }}, { upsert: true })
      Show
      From SERVER-6835 : use test db.repro.update({ "_id.shardKey" : 1, "_id" : {shardKey: 1, uniquifier: 1}}, { $setOnInsert: { payload: 1 }}, { upsert: true })

      Attempting to repro the scenario reported in SERVER-6835 led to the realization that the behavior has deteriorated. Instead of creating a document with 2 _id fields, the command now crashes the mongod.

      The command:

      db.repro.update({"_id.shardKey": 1, "_id": {shardKey: 1, uniquifier: 1}}, { $setOnInsert: { payload: 1 }}, { upsert: true })

      Stack trace:

      #0  0x00000001002ff2d7 in mongo::pathsupport::findLongestPrefix (root={_doc = 0x104aa5c78, _repIdx = 0}, prefix=@0x104aa5960, idxFound=0x104aa5960, elemFound=0x104aa5960)
          at path_support.cpp:152
      #1  0x000000010031124f in mongo::Status::code () at /Users/Amalia/mongo/src/mongo/base/status-inl.h:184
      #2  0x000000010031124f in mongo::UpdateDriver::createFromQuery (query=@0x104aa59a0, doc=@0x104aa5c78) at update_driver.cpp:186
      #3  0x000000010030d0b0 in mongo::Status::isOK () at update.cpp:461
      #4  0x000000010030d0b0 in mongo::Status::code () at /Users/Amalia/mongo/src/mongo/base/status-inl.h:215
      #5  0x000000010030d0b0 in mongo::UpdateRequest::getQuery () at /Users/Amalia/mongo/src/mongo/db/ops/update_request.h:41
      #6  0x000000010030d0b0 in mongo::update (request=@0x104aa61a0, opDebug=0x104aa61a0, driver=0x104aa61a0) at update.cpp:461
      #7  0x00000001002912ba in mongo::receivedUpdate (m=@0x104aa65e0, op=@0x104aa65e0) at instance.cpp:678
      #8  0x00000001002954ba in mongo::assembleResponse (m=@0x104aa61e8, dbresponse=@0x104aa6b60, remote=@0x5) at instance.cpp:486
      #9  0x0000000100007144 in mongo::MyMessageHandler::process (this=0x104aa61e8, m=@0x104aa6c70, port=0x104aa6c70, le=0x104aa6c70) at db.cpp:199
      #10 0x00000001005da701 in boost::shared_ptr<mongo::Socket>::operator-> () at /Users/Amalia/mongo/src/third_party/boost/boost/smart_ptr/shared_ptr.hpp:209
      #11 0x00000001005da701 in mongo::PortMessageServer::handleIncomingMsg (arg=0x104aa61e8) at message_server_port.cpp:210
      #12 0x00000001006420b5 in thread_proxy (param=0x1043ef600) at thread.cpp:121
      #13 0x00007fff907858bf in _pthread_start ()
      #14 0x00007fff90788b75 in thread_start ()

            Assignee:
            scotthernandez Scott Hernandez (Inactive)
            Reporter:
            amalia.hawkins@10gen.com Amalia Hawkins
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: