[CXX-1252] Tailable cursors only work once Created: 13/Mar/17  Updated: 28/Feb/18  Resolved: 17/Mar/17

Status: Closed
Project: C++ Driver
Component/s: Implementation
Affects Version/s: 3.1.1
Fix Version/s: 3.2.0-rc0, 3.1.4

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

Attachments: File tailable-broken.cpp    
Issue Links:
Depends

 Description   

When using a tailable cursor, only the first iteration to cursor::end() works and subsequent iteration attempts find nothing. See the attached file for an example.

This is almost certainly a consequence of the way cursors are marked dead in the fix for CXX-1001 and CXX-1100, which should not happen if the cursor is tailable.

I also see that we have no integration tests for tailable cursors, or we'd have caught this breakage earlier.



 Comments   
Comment by Githook User [ 17/Mar/17 ]

Author:

{u'username': u'xdg', u'name': u'David Golden', u'email': u'xdg@xdg.me'}

Message: CXX-1252 Tailable cursors only work once

The way cursors were marked dead to support multiple iterators
on the same cursor had a side effect of preventing tailable cursors
from working.

This commit makes cursors know if they are tailable and rather than
marking tailable cursors dead, they are marked "pending" so they
can restart if re-iterated.
Branch: master
https://github.com/mongodb/mongo-cxx-driver/commit/32b1b26c3f0c1c71962743c31d2ac79eab1a9585

Generated at Wed Feb 07 22:01:56 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.