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

Invariant failure when running applyOps to create an index with a bad ns field

    XMLWordPrintable

    Details

    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Backport Completed:
    • Sprint:
      Repl E (01/08/16), Repl F (01/29/16)
    • Linked BF Score:
      0

      Description

      The applyOps command can trigger an invariant failure when creating an index via a system.indexes write.

      Invariant failure _name == nsToDatabaseSubstring(ns)
       
      * thread #17: tid = 0xe8569, 0x00007fff9a36370e libsystem_kernel.dylib`__write_nocancel + 10
        * frame #0: 0x00007fff9a36370e libsystem_kernel.dylib`__write_nocancel + 10
          frame #1: 0x00007fff936f3202 libsystem_c.dylib`_swrite + 87
          frame #2: 0x00007fff936eb72c libsystem_c.dylib`__sflush + 87
          frame #3: 0x00007fff936ee040 libsystem_c.dylib`__sfvwrite + 823
          frame #4: 0x00007fff936ee34a libsystem_c.dylib`fwrite + 153
          frame #5: 0x00007fff8730438c libc++.1.dylib`std::__1::__stdoutbuf<char>::overflow(int) + 84
          frame #6: 0x00007fff872fa1cd libc++.1.dylib`std::__1::basic_streambuf<char, std::__1::char_traits<char> >::xsputn(char const*, long) + 73
          frame #7: 0x00007fff873011cd libc++.1.dylib`std::__1::basic_ostream<char, std::__1::char_traits<char> >::write(char const*, long) + 73
          frame #8: 0x0000000100051545 mongod`mongo::operator<<(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, mongo::StringData)(stream=0x00007fff76a102f8, value=(_data = "\n\n***aborting after invariant() failure\n\n\n", _size = 42)) + 69 at string_data.cpp:57
          frame #9: 0x000000010112b53b mongod`mongo::logger::MessageEventDetailsEncoder::encode(this=0x0000000105017f30, event=0x0000700000825918, os=0x00007fff76a102f8) + 731 at message_event_utf8_encoder.cpp:77
          frame #10: 0x0000000100761be0 mongod`mongo::logger::ConsoleAppender<mongo::logger::MessageEventEphemeral, mongo::Console>::append(this=0x0000000105013320, event=0x0000700000825918) + 192 at console_appender.h:53
          frame #11: 0x000000010112c0ae mongod`mongo::logger::LogDomain<mongo::logger::MessageEventEphemeral>::append(this=0x00000001050132d8, event=0x0000700000825918) + 574 at log_domain-impl.h:59
          frame #12: 0x0000000101128299 mongod`mongo::logger::LogstreamBuilder::~LogstreamBuilder(this=0x0000700000825e48) + 1401 at logstream_builder.cpp:129
          frame #13: 0x0000000101128c45 mongod`mongo::logger::LogstreamBuilder::~LogstreamBuilder(this=0x0000700000825e48) + 21 at logstream_builder.cpp:121
          frame #14: 0x00000001014b800e mongod`mongo::invariantFailed(expr="_name == nsToDatabaseSubstring(ns)", file="src/mongo/db/catalog/database.cpp", line=429) + 382 at assert_util.cpp:152
          frame #15: 0x000000010031ac5d mongod`mongo::Database::getCollection(this=0x0000000105011be0, ns=(_data = "u", _size = 1)) const + 141 at database.cpp:429
          frame #16: 0x0000000100752363 mongod`mongo::IndexBuilder::_build(this=0x0000700000827158, txn=0x0000000105012f20, db=0x0000000105011be0, allowBackgroundBuilding=false, dbLock=0x0000000000000000) const + 323 at index_builder.cpp:128
          frame #17: 0x0000000100753372 mongod`mongo::IndexBuilder::buildInForeground(this=0x0000700000827158, txn=0x0000000105012f20, db=0x0000000105011be0) const + 50 at index_builder.cpp:110
          frame #18: 0x0000000100bfca0c mongod`mongo::repl::applyOperation_inlock(txn=0x0000000105012f20, db=0x0000000105011be0, op=0x000070000082a418, convertUpdateToUpsert=true, incrementOpsAppliedStats=mongo::repl::IncrementOpsAppliedStatsFn @ 0x000070000082a900)>) + 3164 at oplog.cpp:754
          frame #19: 0x00000001002d713a mongod`mongo::applyOps(txn=0x0000000105012f20, dbName="admin", applyOpCmd=0x000070000082aeb0, result=0x000070000082b040) + 4394 at apply_ops.cpp:141
          frame #20: 0x0000000100371c72 mongod`mongo::ApplyOpsCmd::run(this=0x00000001029a6e00, txn=0x0000000105012f20, dbname="admin", cmdObj=0x000070000082aeb0, (null)=0, errmsg="", result=0x000070000082b040) + 658 at apply_ops.cpp:112
          frame #21: 0x00000001004ceeca mongod`mongo::Command::run(this=0x00000001029a6e00, txn=0x0000000105012f20, request=0x000070000082bed0, replyBuilder=0x000070000082c080) + 3690 at dbcommands.cpp:1441
          frame #22: 0x00000001004cdb30 mongod`mongo::Command::execCommand(txn=0x0000000105012f20, command=0x00000001029a6e00, request=0x000070000082bed0, replyBuilder=0x000070000082c080) + 5264 at dbcommands.cpp:1326
          frame #23: 0x000000010036f6a6 mongod`mongo::runCommands(txn=0x0000000105012f20, request=0x000070000082bed0, replyBuilder=0x000070000082c080) + 2118 at commands.cpp:498
          frame #24: 0x0000000100765f34 mongod`mongo::(anonymous namespace)::receivedRpc(txn=0x0000000105012f20, client=0x0000000105130f20, dbResponse=0x000070000082d430, message=0x000070000082db90) + 628 at instance.cpp:304
          frame #25: 0x0000000100762edd mongod`mongo::assembleResponse(txn=0x0000000105012f20, m=0x000070000082db90, dbresponse=0x000070000082d430, remote=0x000070000082d1b0) + 2301 at instance.cpp:525
          frame #26: 0x000000010000c24d mongod`mongo::MyMessageHandler::process(this=0x0000000105011180, m=0x000070000082db90, port=0x0000000105012500) + 397 at db.cpp:171
      


      Version: 176fad1a68fd9d0750a3aa4b33c2eb20be7d39ec

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: