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

Count with no results, never yields

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.6.0-rc3
    • Affects Version/s: 2.6.0-rc0
    • Component/s: Internal Code, Querying
    • None

      This commit causes a regression such that no yielding will happen if the policy isn't set due to never entering the loop, which enables the auto-yielding policy. This can also be seen in more complicated scenarios where the timer has yet to trigger the policy and nothing is returned thus delaying the policy being set until a result is found (after the timer triggers), and then yielding will happen after that.

      The easiest way to see this is to run a count with a query which matches nothing, causing a collection scan.

      This also affects maxTimeMS timeouts, and trying to kill the op, since without the yielding checks the count cannot be terminated.

      https://github.com/mongodb/mongo/blob/2850cc7253344c639bc9a01bc6dff3ffd2cca422/src/mongo/db/ops/count.cpp#L98

            Assignee:
            hari.khalsa@10gen.com hari.khalsa@10gen.com
            Reporter:
            scotthernandez Scott Hernandez (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: