-
Notifications
You must be signed in to change notification settings - Fork 244
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DRIVERS-2533: add RunCursorCommand API #1412
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jmikola
reviewed
Apr 28, 2023
Co-authored-by: Jeremy Mikola <jmikola@gmail.com>
dariakp
requested changes
Apr 28, 2023
prestonvasquez
approved these changes
May 19, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
prestonvasquez
requested changes
May 19, 2023
source/client-side-operations-timeout/tests/runCursorCommand.yml
Outdated
Show resolved
Hide resolved
source/client-side-operations-timeout/tests/runCursorCommand.yml
Outdated
Show resolved
Hide resolved
prestonvasquez
previously approved these changes
May 22, 2023
prestonvasquez
dismissed
their stale review
May 22, 2023 20:27
Approved by accident. Still working through serverless CSOT test cases.
source/client-side-operations-timeout/tests/runCursorCommand.yml
Outdated
Show resolved
Hide resolved
source/client-side-operations-timeout/tests/runCursorCommand.yml
Outdated
Show resolved
Hide resolved
source/client-side-operations-timeout/tests/runCursorCommand.yml
Outdated
Show resolved
Hide resolved
source/client-side-operations-timeout/tests/runCursorCommand.yml
Outdated
Show resolved
Hide resolved
prestonvasquez
approved these changes
May 23, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Adds a new runCursorCommand database API that can handle running a generic command that returns a cursor from the server. MongoDB cursors need the client to track some pieces of metadata that are generally internal to a driver implementation (session.lsid, cursor.id, server/connection, namespace) so this API is aware that the command being run needs to maintain these components for subsequent iteration of the cursor, via
getMore
commands.Changes
id
andns
upon every getMore response$clusterTime
- an additional property the driver MUST attach to the command sent to the server on behalf of the usersuccessfully executes checkMetadataConsistency cursor creating command
errors if the command response is not a cursor
creates an implicit session that is reused across getMores
accepts an explicit session that is reused across getMores
returns pinned connections to the pool when the cursor is exhausted
returns pinned connections to the pool when the cursor is closed
supports configuring getMore batchSize
supports configuring getMore maxTimeMS
supports configuring getMore comment
does not close the cursor when receiving an empty batch
runCursorCommand
operation that iterates a cursor to exhaustion in one operationcreateCommandCursor
operation that saves an entity to be iterated laterclose
anditerateUntilDocumentOrError
are expected to support the new entityrunCursorCommand creates and exhausts cursor by running getMores
createCommandCursor creates a cursor and stores it as an entity that can be iterated one document at a time
createCommandCursor cursor can be closed and will perform a killCursors operation
errors if timeoutMode is set without timeoutMS
error if timeoutMode is cursorLifetime and cursorType is tailableAwait
error if getMore maxTimeMS setting is greater than timeoutMS
error if getMore maxTimeMS setting is equal to timeoutMS
Non-tailable cursor lifetime remaining timeoutMS applied to getMore if timeoutMode is unset
Non=tailable cursor iteration timeoutMS is refreshed for getMore if timeoutMode is iteration - failure
Tailable cursor iteration timeoutMS is refreshed for getMore - failure
Tailable cursor awaitData iteration timeoutMS is refreshed for getMore - failure
Tasks