[SERVER-9391] tailable cursors should throw an exception in DBClientCursor when a cursor is not found on the server Created: 18/Apr/13  Updated: 28/Feb/20  Resolved: 28/Feb/20

Status: Closed
Project: Core Server
Component/s: Internal Client
Affects Version/s: None
Fix Version/s: 4.3.4

Type: Bug Priority: Major - P3
Reporter: Eric Milkie Assignee: Cheahuychou Mao
Resolution: Done Votes: 0
Labels: cxxcopy, neweng, query-44-grooming, servicearch-needsinvestigation
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Service Arch 2020-03-09
Participants:

 Description   

dbclientcursor.cpp
DBClientCursor::dataReceived() has different behavior when the server replies that the cursor is not found. For nontailable cursors, it clears the client cursorId and throws an exception. For tailable cursors, it only clears the client cursorId, so the consumer must check it in order to discover that calling more() will never return more data.

There does not appear to be a good reason for this, so we should unify the behavior and make all cursor types throw an exception in dataReceived() when the server returns CursorNotFound.



 Comments   
Comment by Githook User [ 28/Feb/20 ]

Author:

{'name': 'Cheahuychou Mao', 'username': 'cheahuychou', 'email': 'cheahuychou.mao@mongodb.com'}

Message: SERVER-9391 tailable cursors should throw an exception in DBClientCursor when a cursor is not found on the server
Branch: master
https://github.com/mongodb/mongo/commit/0219d8e3489f7934c3eda10a18ac70de81d1e7b4

Comment by David Storch [ 16/Aug/19 ]

The code that milkie is referring to here appears to still exist in the code base:

https://github.com/mongodb/mongo/blob/6e040109a8dceca0c83a66c2398af6f19ee2449a/src/mongo/client/dbclient_cursor.cpp#L341-L352

This internal client code (DBClientCursor) is not maintained by the query team. My best guess is that it should be triaged by Service Architecture, so I'm flagging it as such.

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