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

mongod crashes after combining sort with hint in v2.5.4

    • Type: Icon: Bug Bug
    • Resolution: Incomplete
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Querying
    • Labels:
      None
    • Server Triage
    • ALL
    • Hide

      (using the USA cities database)

      db = db.getMongo().getDB("usa");

      db.cities.ensureIndex({city: -1, pop: -1, state: -1});

      cursor = db.cities.find({id: '05356'}).hint("city-1_pop_-1_state_-1").sort({_id: -1}).limit(100);

      cursor_explain = cursor.explain();
      cursor_count = cursor.count();
      cursor_size = cursor.size();

      db.getSisterDB("results")[TEST_NAME + ".explain"].insert({explain: tojson(cursor_explain)});

      cursor.forEach(function(doc) {db.getSisterDB("results")[TEST_NAME].insert(doc);});

      Show
      (using the USA cities database) db = db.getMongo().getDB("usa"); db.cities.ensureIndex({city: -1, pop: -1, state: -1}); cursor = db.cities.find({ id: '05356'}).hint("city -1_pop_-1_state_-1").sort({_id: -1}).limit(100); cursor_explain = cursor.explain(); cursor_count = cursor.count(); cursor_size = cursor.size(); db.getSisterDB("results") [TEST_NAME + ".explain"] .insert({explain: tojson(cursor_explain)}); cursor.forEach(function(doc) {db.getSisterDB("results") [TEST_NAME] .insert(doc);});

      While performing an academic experiment based on the random generation of a large set of tests to exercise the Query Language of MongoDB (all of which syntactically valid), a possible bug was detected in one specific test that executes a query (find()), provides a hint() and sort()'s its results.

      The same query was executed without sort() or hint() and was successful (i.e., only find()), with find().hint() and was also successful, with find().sort() an error is thrown in the assertion at line 1014 in query_planner.cpp, and with find().hint().sort() the mongod service crashes unexpectedly.

            Assignee:
            backlog-server-triage [HELP ONLY] Backlog - Triage Team
            Reporter:
            jagnelo@student.dei.uc.pt João Agnelo
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: