[SERVER-36299] Implement support for exhaust cursors with OP_MSG in DBClientCursor Created: 26/Jul/18  Updated: 29/Oct/23  Resolved: 06/Sep/18

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

Type: Task Priority: Major - P3
Reporter: Tess Avitabile (Inactive) Assignee: William Schultz (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-36539 Test that DBClientCursor sends getMor... Closed
Related
is related to SERVER-36105 Implement server support for exhaust ... Closed
Backwards Compatibility: Fully Compatible
Sprint: Repl 2018-08-13, Repl 2018-08-27, Repl 2018-09-10
Participants:
Linked BF Score: 0

 Description   

DBClientCursor will implement the client side of the exhaust cursor OP_MSG protocol when commands are being used and QueryOption_Exhaust is requested.

  • When more() is called after the initial find command, it will set the wire protocol bit exhaustAllowed on the getMore command it sends.  DBClientCursor will not set this bit on initial find commands.  Note that older implementations which do not support OP_MSG exhaust will ignore this bit, as required by the wire protocol spec.
  • When more() is called after there was a response to the getMore command that had the wire protocol moreToCome bit set, it will receive the next batch and make it available to the caller.
  • If the response does not have the moreToCome bit set and it indicates an error or the cursor is exhausted (cursor id of 0), more() will return false.
  • If the response does not have the moreToCome bit set, and also does not indicate the cursor is exhausted or contain an error, DBClientCursor will send another getMore command.  This handles the upgrade case when connecting to a 4.0 implementation which does not support OP_MSG exhaust.

As part of this work, we will remove OP_QUERY exhaust support from DBClientConnection.  This is currently used only by the database cloner, so the only effect of this will be to cause a performance regression when cloning between 4.0 and 4.2, and the commands which use the database cloner are deprecated.



 Comments   
Comment by Githook User [ 07/Sep/18 ]

Author:

{'name': 'William Schultz', 'email': 'william.schultz@mongodb.com', 'username': 'will62794'}

Message: SERVER-36299 Add integration test for exhaust with OP_MSG

This reverts commit 2d79aaf6d2b65f0355fcaa5d368ec3c4f493495a.
Branch: master
https://github.com/mongodb/mongo/commit/a8fe1d82c3c5484c7e8a6402a34bc45ea11d06f1

Comment by Githook User [ 07/Sep/18 ]

Author:

{'name': 'William Schultz', 'email': 'william.schultz@mongodb.com', 'username': 'will62794'}

Message: Revert "SERVER-36299 Add integration test for exhaust with OP_MSG"

This reverts commit 1fa70da99c004b19b21f182b8e65edf781411c5f.
Branch: master
https://github.com/mongodb/mongo/commit/2d79aaf6d2b65f0355fcaa5d368ec3c4f493495a

Comment by Githook User [ 06/Sep/18 ]

Author:

{'name': 'William Schultz', 'email': 'william.schultz@mongodb.com', 'username': 'will62794'}

Message: SERVER-36299 Add integration test for exhaust with OP_MSG
Branch: master
https://github.com/mongodb/mongo/commit/1fa70da99c004b19b21f182b8e65edf781411c5f

Comment by Githook User [ 28/Aug/18 ]

Author:

{'name': 'William Schultz', 'email': 'william.schultz@mongodb.com', 'username': 'will62794'}

Message: SERVER-36299 Ensure that dbclient_cursor_test clears last sent message in between requests
Branch: master
https://github.com/mongodb/mongo/commit/2eb308afe270f9443d60f2f8ae574f5b1ea1fd37

Comment by William Schultz (Inactive) [ 28/Aug/18 ]

Code review 229430001 is for the addition of the functional changes along with unit tests for DBClientCursor.
Code review 241270003 is for the addition of a C++ integration test for exhaust with OP_MSG.

Comment by Githook User [ 22/Aug/18 ]

Author:

{'name': 'William Schultz', 'email': 'william.schultz@mongodb.com', 'username': 'will62794'}

Message: SERVER-36299 Add newline to end of dbclient_cursor_test.cpp file
Branch: master
https://github.com/mongodb/mongo/commit/7618295b2fd4cba46d76afbb97ed732e4228932f

Comment by Githook User [ 22/Aug/18 ]

Author:

{'name': 'William Schultz', 'email': 'william.schultz@mongodb.com', 'username': 'will62794'}

Message: SERVER-36299 Add support for exhaust cursors with OP_MSG in DBClientCursor
Branch: master
https://github.com/mongodb/mongo/commit/fe0baa54e765a23d165b5983e2f50f7f2c13d20c

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