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

Cursor count incorrectly reports non-zero value

    • Type: Icon: Bug Bug
    • Resolution: Incomplete
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Querying
    • Labels:
      None
    • Environment:
      mongodb-2.2, pymongo 2.4,
    • ALL

      (I'm marking this minor due to the ancientness of the release not severity of the issue.)

      We created a new index and suddenly queries using that index were reporting non-zero counts when they had zero elements in their resultset. I've put the console output in the attachment which shows cursor.count() returning non-zero but attempts to access element 0 generating an error and then shows the explain which clearly shows that `n` is 0.

      The index we created was

      ensureIndex({'_id.tag': 1, '_id.org': 1, '_id.course': 1, 'definition.children': 1})

      When we deleted the index, the code worked once again.

      This is for the open sourced edx.org code base (feel free to look at the code base.py _get_raw_parent_location)

            Assignee:
            sam.kleinman Sam Kleinman (Inactive)
            Reporter:
            dmitchell@edx.org Don Mitchell
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: