[SERVER-2009] potentially incorrectly handled test in client cursor may result in improper skipping Created: 26/Oct/10  Updated: 12/Jul/16  Resolved: 03/Jun/11

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: None
Fix Version/s: 1.9.1

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   

I haven't confirmed this behavior with a test, but it looks like the following sequence of events may be possible:

1) a client cursor points to a btree entry with key 'a' with disk loc X and is yielding or awaiting getMore
2) the object at loc X is modified in place so as to not contain key 'a'
3) the object at loc X is removed

As part of 3), clientcursor's aboutToDelete() will expect to find a cursor pointing at btree node <'a',X> and call checkLocation() on that cursor. Because the btree key has been removed, checkLocation() will advance to the next key past the expected one. If this key has a refLoc other than X (which is quite likely), aboutToDelete() will log a warning and advance the cursor again anyway, even though it should not advance because the btree key is pointing at a different record location.



 Comments   
Comment by auto [ 02/Jun/11 ]

Author:

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

Message: SERVER-2009 don't skip location on yield recovery when the location has already been updated
Branch: master
https://github.com/mongodb/mongo/commit/f2beea161e769f7bc70a5994c16337e605f4e748

Comment by auto [ 25/Mar/11 ]

Author:

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

Message: SERVER-2009 add test for spurious wassert on delete
https://github.com/mongodb/mongo/commit/819f4001dff0678aa3550b3eec6ac699fddf6b66

Comment by auto [ 25/Mar/11 ]

Author:

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

Message: SERVER-2009 test where a document is incorrectly skipped
https://github.com/mongodb/mongo/commit/aac5e1bd9b6d6cd9ce6e93fef1a2db01873eec4b

Generated at Thu Feb 08 02:58:42 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.