[SERVER-2809] assertion in count / userquery op nscanned after failed yield recovery Created: 21/Mar/11  Updated: 12/Jul/16  Resolved: 22/Mar/11

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: None
Fix Version/s: 1.8.1, 1.9.0

Type: Bug Priority: Major - P3
Reporter: Aaron Staple Assignee: Aaron Staple
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Participants:

 Description   

Given current behavior on failed yield it looks like we don't want to depend on _c in nscanned().



 Comments   
Comment by auto [ 23/Mar/11 ]

Author:

{u'login': u'astaple', u'name': u'Aaron', u'email': u'aaron@10gen.com'}

Message: SERVER-2809 update _nscanned with proper value, now that it may be returned
https://github.com/mongodb/mongo/commit/6021266abb19d3f1ff56465d0a7185699429b3c5

Comment by auto [ 23/Mar/11 ]

Author:

{u'login': u'astaple', u'name': u'Aaron', u'email': u'aaron@10gen.com'}

Message: SERVER-2809 don't read cursor's nscanned if failed yield invalidated the cursor
https://github.com/mongodb/mongo/commit/0d5979c50b07075f608e8341f3629e786badc5ca

Comment by Aaron Staple [ 22/Mar/11 ]

Here are some ideas for working around this issue in 1.8.0

  • just retry the query if it fails (the error is sporadic and just prevents a single query from running successfully)
  • hint your query with an index - if you are doing a count(), convert to the corresponding find() and hint() that
  • if your collection is capped, make it non capped instead
  • adjust query / indexes so that there is an index that is optimal for the query
  • if it's a capped collection, don't insert while you are running count
Comment by auto [ 22/Mar/11 ]

Author:

{u'login': u'astaple', u'name': u'Aaron', u'email': u'aaron@10gen.com'}

Message: SERVER-2809 update _nscanned with proper value, now that it may be returned
https://github.com/mongodb/mongo/commit/dc14c92069ade9dd88dc2cf7a7e628a71f7266a8

Comment by auto [ 22/Mar/11 ]

Author:

{u'login': u'astaple', u'name': u'Aaron', u'email': u'aaron@10gen.com'}

Message: SERVER-2809 don't read cursor's nscanned if failed yield invalidated the cursor
https://github.com/mongodb/mongo/commit/c27b5406692acf0826c9ca4f25f2c6c5768aba0f

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