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

Index with specific name length will throw assertion on removal but not on creation

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.4.0
    • Component/s: Internal Code
    • None
    • ALL

      The following code:

      c = db.getSiblingDB("jstests_tool_dumprestore_24").getCollection("collection");
      c.ensureIndex({ "a" : 1, "b" : 1, "c" : 1, "indexpropertycounter0" : 1, "indexpropertycounter1" : 1, "indexpropertycounter2" : 1});
      c.drop();
      

      Will produce this stack trace from mongod:

       0   mongod                              0x0000000100d5ed85 mongo::printStackTrace(std::ostream&) + 37
       1   mongod                              0x0000000100cbc094 mongo::logContext(char const*) + 228
       2   mongod                              0x0000000100c97656 mongo::msgasserted(int, char const*) + 390
       3   mongod                              0x0000000100c978aa mongo::ExceptionInfo::append(mongo::BSONObjBuilder&, char const*, char const*) const + 0
       4   mongod                              0x00000001002436f5 mongo::Namespace::extraName(int) const + 369
       5   mongod                              0x0000000100242553 mongo::NamespaceIndex::kill_ns(mongo::StringData const&) + 149
       6   mongod                              0x0000000100375f77 mongo::Database::_dropNS(mongo::StringData const&) + 1205
       7   mongod                              0x000000010022e259 mongo::IndexCatalog::_dropIndex(int) + 641
       8   mongod                              0x000000010022f584 mongo::IndexCatalog::dropIndex(int) + 316
       9   mongod                              0x000000010022fa3f mongo::IndexCatalog::dropAllIndexes(bool) + 805
       10  mongod                              0x000000010037a351 mongo::Database::dropCollection(mongo::StringData const&) + 1205
       11  mongod                              0x0000000100392b33 mongo::CmdDrop::run(std::string const&, mongo::BSONObj&, int, std::string&, mongo::BSONObjBuilder&, bool) + 1267
       12  mongod                              0x0000000100389f46 mongo::_execCommand(mongo::Command*, std::string const&, mongo::BSONObj&, int, std::string&, mongo::BSONObjBuilder&, bool) + 118
       13  mongod                              0x000000010038c681 mongo::Command::execCommand(mongo::Command*, mongo::Client&, int, char const*, mongo::BSONObj&, mongo::BSONObjBuilder&, bool) + 7059
       14  mongod                              0x000000010038da2f mongo::_runCommands(char const*, mongo::BSONObj&, mongo::_BufBuilder<mongo::TrivialAllocator>&, mongo::BSONObjBuilder&, bool, int) + 2303
       15  mongod                              0x00000001007fbb15 mongo::runCommands(char const*, mongo::BSONObj&, mongo::CurOp&, mongo::_BufBuilder<mongo::TrivialAllocator>&, mongo::BSONObjBuilder&, bool, int) + 117
       16  mongod                              0x00000001007fce1a mongo::newRunQuery(mongo::Message&, mongo::QueryMessage&, mongo::CurOp&, mongo::Message&) + 1674
       17  mongod                              0x00000001005a85fb mongo::receivedQuery(mongo::Client&, mongo::DbResponse&, mongo::Message&) + 859
       18  mongod                              0x00000001005ac6c9 mongo::assembleResponse(mongo::Message&, mongo::DbResponse&, mongo::HostAndPort const&) + 1225
       19  mongod                              0x000000010000c689 mongo::MyMessageHandler::process(mongo::Message&, mongo::AbstractMessagingPort*, mongo::LastError*) + 335
      

      It comes from the fact that we are checking for "<indexname>" + "$extra" rather than just the index in the "Namespace::extraName" function on deletion, but not during creation. I suspect we aren't actually creating the "extraName" index, but I don't know what the purpose of this extra index actually is.

            Assignee:
            Unassigned Unassigned
            Reporter:
            sverch Shaun Verch
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: