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

logOp rollback in findAndModify when query for modified document fails (fatal assertion)

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 3.0.0-rc9, 3.1.0
    • Affects Version/s: 3.0.0-rc8
    • Component/s: Querying
    • Fully Compatible
    • ALL

      A findAndModify command can trigger a (fatal) logOp rollback when a) an update is performed, b) the modified document is requested, and c) the query for the modified document fails to create a PlanExecutor.

      The third condition can be satisfied by the combination of --notablescan and {autoIndexId: false}, though there may be other ways to trigger the PlanExecutor failure.

      Assertion: 17245:Could not get executor for query { _id: 0.0 }
      ...
      Rollback of logOp not currently allowed (SERVER-15192)
      Fatal Assertion 18805
      
      #0  0x00007ffff7bcc20b in raise (sig=5) at ../nptl/sysdeps/unix/sysv/linux/pt-raise.c:37
      #1  0x00000000018cab92 in mongo::breakpoint () at src/mongo/util/debugger.cpp:63
      #2  0x00000000018bfc4a in mongo::fassertFailed (msgid=18805) at src/mongo/util/assert_util.cpp:165
      #3  0x00000000015f0454 in mongo::repl::RollbackPreventer::rollback (this=0x30c2440) at src/mongo/db/repl/oplog.cpp:389
      #4  0x00000000016f839e in mongo::DurRecoveryUnit::rollbackInnermostChanges (this=0x32c4580) at src/mongo/db/storage/mmap_v1/dur_recovery_unit.cpp:167
      #5  0x00000000016f7ad4 in mongo::DurRecoveryUnit::endUnitOfWork (this=0x32c4580) at src/mongo/db/storage/mmap_v1/dur_recovery_unit.cpp:78
      #6  0x0000000001141d04 in mongo::WriteUnitOfWork::~WriteUnitOfWork (this=0x7ffff7fc9e20, __in_chrg=<optimized out>) at src/mongo/db/operation_context.h:156
      #7  0x00000000012bbadc in mongo::CmdFindAndModify::runImpl (txn=0x7ffff7fcb7d0, dbname=..., ns=..., query=..., fields=..., update=..., sort=..., upsert=true, returnNew=true, remove=false, result=..., 
          errmsg=...) at src/mongo/db/commands/find_and_modify.cpp:294
      #8  0x00000000012b94c5 in mongo::CmdFindAndModify::run (this=0x2873540 <mongo::cmdFindAndModify>, txn=0x7ffff7fcb7d0, dbname=..., cmdObj=..., options=0, errmsg=..., result=..., fromRepl=false)
          at src/mongo/db/commands/find_and_modify.cpp:132
      #9  0x0000000001337785 in mongo::_execCommand (txn=0x7ffff7fcb7d0, c=0x2873540 <mongo::cmdFindAndModify>, dbname=..., cmdObj=..., queryOptions=0, errmsg=..., result=..., fromRepl=false)
          at src/mongo/db/dbcommands.cpp:1290
      #10 0x0000000001338702 in mongo::Command::execCommand (txn=0x7ffff7fcb7d0, c=0x2873540 <mongo::cmdFindAndModify>, queryOptions=0, cmdns=0x33fc414 "test.$cmd", cmdObj=..., result=..., fromRepl=false)
          at src/mongo/db/dbcommands.cpp:1506
      #11 0x0000000001338fe1 in mongo::_runCommands (txn=0x7ffff7fcb7d0, ns=0x33fc414 "test.$cmd", _cmdobj=..., b=..., anObjBuilder=..., fromRepl=false, queryOptions=0) at src/mongo/db/dbcommands.cpp:1578
      #12 0x000000000153c0b0 in mongo::runCommands (txn=0x7ffff7fcb7d0, ns=0x33fc414 "test.$cmd", jsobj=..., curop=..., b=..., anObjBuilder=..., fromRepl=false, queryOptions=0) at src/mongo/db/query/find.cpp:137
      #13 0x000000000153e0d8 in mongo::runQuery (txn=0x7ffff7fcb7d0, m=..., q=..., nss=..., curop=..., result=..., fromDBDirectClient=false) at src/mongo/db/query/find.cpp:606
      #14 0x0000000001443fd4 in mongo::receivedQuery (txn=0x7ffff7fcb7d0, c=..., dbresponse=..., m=..., fromDBDirectClient=false) at src/mongo/db/instance.cpp:220
      #15 0x000000000144517e in mongo::assembleResponse (txn=0x7ffff7fcb7d0, m=..., dbresponse=..., remote=..., fromDBDirectClient=false) at src/mongo/db/instance.cpp:403
      #16 0x0000000001142708 in mongo::MyMessageHandler::process (this=0x30c21c8, m=..., port=0x30e9610, le=0x34022d0) at src/mongo/db/db.cpp:206
      #17 0x00000000018e8d86 in mongo::PortMessageServer::handleIncomingMsg (arg=0x30e9610) at src/mongo/util/net/message_server_port.cpp:229
      #18 0x00007ffff7bc4182 in start_thread (arg=0x7ffff7fcc700) at pthread_create.c:312
      #19 0x00007ffff6cc500d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
      

            Assignee:
            david.storch@mongodb.com David Storch
            Reporter:
            kamran.khan Kamran K.
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: