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

Cursor count incorrectly reports non-zero value

    XMLWordPrintable

    Details

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

      Description

      (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)

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: