[SERVER-13336] Count with no results, never yields Created: 24/Mar/14  Updated: 11/Jul/16  Resolved: 25/Mar/14

Status: Closed
Project: Core Server
Component/s: Internal Code, Querying
Affects Version/s: 2.6.0-rc0
Fix Version/s: 2.6.0-rc3

Type: Task Priority: Major - P3
Reporter: Scott Hernandez (Inactive) Assignee: hari.khalsa@10gen.com
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Related
is related to SERVER-12554 Count queries negatively impact concu... Closed
Participants:

 Description   

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



 Comments   
Comment by Githook User [ 30/Mar/14 ]

Author:

{u'username': u'RedBeard0531', u'name': u'Mathias Stearn', u'email': u'mathias@10gen.com'}

Message: SERVER-13336 IndexUpdateTests: Only try to kill index builds

Now that counts can yield, they can be killed. The killAll() calls above were
not intended to effect the counts.

(cherry picked from commit 00c8264c88edbbda91c375063c2c612b1db18702)
Branch: v2.6
https://github.com/mongodb/mongo/commit/2ed3157c0c78d603116d96b36750d7f8463c3139

Comment by Githook User [ 30/Mar/14 ]

Author:

{u'username': u'RedBeard0531', u'name': u'Mathias Stearn', u'email': u'mathias@10gen.com'}

Message: SERVER-13336 IndexUpdateTests: Only try to kill index builds

Now that counts can yield, they can be killed. The killAll() calls above were
not intended to effect the counts.
Branch: master
https://github.com/mongodb/mongo/commit/00c8264c88edbbda91c375063c2c612b1db18702

Comment by Githook User [ 25/Mar/14 ]

Author:

{u'username': u'hkhalsa', u'name': u'Hari Khalsa', u'email': u'hkhalsa@10gen.com'}

Message: SERVER-13336 count should always yield

Revert "SERVER-12554 Lazily yield on count queries."

This reverts commit 2850cc7253344c639bc9a01bc6dff3ffd2cca422.
Branch: v2.6
https://github.com/mongodb/mongo/commit/f77427bddf29b2f07dcd2620abffa57b1f7c2655

Comment by Githook User [ 25/Mar/14 ]

Author:

{u'username': u'hkhalsa', u'name': u'Hari Khalsa', u'email': u'hkhalsa@10gen.com'}

Message: SERVER-13336 count should always yield

Revert "SERVER-12554 Lazily yield on count queries."

This reverts commit 2850cc7253344c639bc9a01bc6dff3ffd2cca422.
Branch: master
https://github.com/mongodb/mongo/commit/1f762a3478bb2f794e72670d333f35c6b7e6cfa7

Generated at Thu Feb 08 03:31:23 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.