-
Notifications
You must be signed in to change notification settings - Fork 245
DRIVERS-2533: add RunCursorCommand API #1412
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
Merged
Merged
Changes from all commits
Commits
Show all changes
82 commits
Select commit
Hold shift + click to select a range
2ba230e
DRIVERS-2533: add RunCursorCommand API
nbbeeken 8d46217
feat: add cleanup req
nbbeeken b688572
feat: add runCursorCommand UTF operation
nbbeeken eff1d85
chore: changelog
nbbeeken be59aa8
feat: add UTF operations and first test
nbbeeken 155677b
feat: lb mode, and more csot
nbbeeken c437e53
docs: add tailable section
nbbeeken 03779a1
feat: add clusterTime gossip
nbbeeken 85e032d
apply suggestions
nbbeeken 508990d
Add links to specs, monospacing, high level steps cleanup
nbbeeken 3420d3e
Add improvements to Find, getMore and killCursors commands
nbbeeken 3dfcd77
comments
nbbeeken 679e14a
add invalid tests
nbbeeken 0aab062
Merge branch 'master' into DRIVERS-2533-runCursorCommand-api
nbbeeken 6745d71
rename invalid test file
nbbeeken 1db918b
add clusterTime assertion
nbbeeken 4890269
add valid pass
nbbeeken b39df09
add more test cases
nbbeeken 31eebfc
fix server version
nbbeeken eb7e34a
add tailable cursor test
nbbeeken 90cb9f0
fix schema issues
nbbeeken f159ebd
gen json
nbbeeken dc73ff8
fix: title
nbbeeken f623935
fix: title
nbbeeken 576d914
fix: title
nbbeeken fa95fc2
gen: json
nbbeeken 6f0ca16
test for errors from non-cursor responses
nbbeeken b7962b7
test: breakout clusterTime to its own test
nbbeeken b9e6fdb
update optionality language
nbbeeken cab4837
update unified test format test titles
nbbeeken a724120
Merge branch 'master' into DRIVERS-2533-runCursorCommand-api
nbbeeken 052f399
test: add misconfiguration tests
nbbeeken eff3eef
Merge branch 'master' into DRIVERS-2533-runCursorCommand-api
nbbeeken 386ef6b
find_getmore_killcursors comments
nbbeeken 3393849
run-command comments
nbbeeken aadfd9d
remove extra assertions for runCommand.yml
nbbeeken 661060a
reduce lsid strictness
nbbeeken 2d206a5
rm empty filter
nbbeeken 34de634
fix getMore value bitwidth
nbbeeken 0994612
add interface for getMore controls
nbbeeken a0ca7bd
ignore result
nbbeeken d522f27
ignore result - correctly
nbbeeken 850f26d
add comment to find
nbbeeken 8f13d54
move CSOT, remove invalid test
nbbeeken 66c7199
getmore and lsid, name fix
nbbeeken 3117133
killCursors array type
nbbeeken 4a7958e
fix getMore settings, pos int mention
nbbeeken 330aead
entity and cursor operations
nbbeeken f30d110
must->should
nbbeeken 7d172b1
changelogs
nbbeeken 80fd8f7
fix rst
nbbeeken 55e5cd8
Merge branch 'master' into DRIVERS-2533-runCursorCommand-api
nbbeeken 2fe6fa8
add option to configure getMore fields and mention of testing
nbbeeken 86a5ee8
remove check for result
nbbeeken 699328f
Add a comment about ignoring extra events
nbbeeken 7391ea2
non-negative
nbbeeken 933c237
update numeric types
nbbeeken ce7631d
suggestions
nbbeeken 259583c
Merge branch 'DRIVERS-2533-runCursorCommand-api' of github.com:mongod…
nbbeeken f0497fe
rm R/W concern sentence, update RP
nbbeeken 0876609
Merge branch 'master' into DRIVERS-2533-runCursorCommand-api
jmikola 09195d5
test: add more CSOT tests
nbbeeken b113dde
Merge branch 'DRIVERS-2533-runCursorCommand-api' of github.com:mongod…
nbbeeken e055387
test: add tailable awaitdata case
nbbeeken e612efe
comments
nbbeeken dc500f5
fix operation name
nbbeeken 7dd20be
fix format
nbbeeken 73703b3
fix: db
nbbeeken 4e50497
docs: cursorType
nbbeeken 5b4651d
fix: clusterTime test
nbbeeken 8a87576
comments
nbbeeken 90f12a6
fix: add documents to insert
nbbeeken 0adbd22
fmt
nbbeeken c50a20d
fix LB test
nbbeeken d4e60c0
descriptive comments
nbbeeken 299705d
LB fix session
nbbeeken 2ea4e3d
remove inequality tests
nbbeeken d3f73c7
add serverless forbid to capped collection test
nbbeeken f498f9a
forbid serverless for csot capped collection tests
nbbeeken 5c8d733
flaky timeouts on serverless
nbbeeken 942549c
update timeouts
nbbeeken 0a42153
fix: comments and timeout value
nbbeeken File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
583 changes: 583 additions & 0 deletions
583
source/client-side-operations-timeout/tests/runCursorCommand.json
Large diffs are not rendered by default.
Oops, something went wrong.
304 changes: 304 additions & 0 deletions
304
source/client-side-operations-timeout/tests/runCursorCommand.yml
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,304 @@ | ||
description: runCursorCommand | ||
|
||
schemaVersion: '1.9' | ||
|
||
runOnRequirements: | ||
- minServerVersion: "4.4" | ||
|
||
createEntities: | ||
- client: | ||
id: &failPointClient failPointClient | ||
useMultipleMongoses: false | ||
- client: | ||
id: &commandClient commandClient | ||
useMultipleMongoses: false | ||
observeEvents: [commandStartedEvent, commandSucceededEvent] | ||
- client: | ||
id: &client client | ||
useMultipleMongoses: false | ||
observeEvents: [commandStartedEvent] | ||
ignoreCommandMonitoringEvents: [killCursors] | ||
- database: # For tests that need success event assertions | ||
id: &commandDb commandDb | ||
client: *commandClient | ||
databaseName: *commandDb | ||
- database: | ||
id: &db db | ||
client: *client | ||
databaseName: *db | ||
- collection: | ||
id: &collection collection | ||
database: *db | ||
collectionName: *collection | ||
|
||
initialData: | ||
- collectionName: *collection | ||
databaseName: *db | ||
documents: &documents | ||
- { _id: 1, x: 11 } | ||
- { _id: 2, x: 22 } | ||
- { _id: 3, x: 33 } | ||
- { _id: 4, x: 44 } | ||
- { _id: 5, x: 55 } | ||
|
||
tests: | ||
- description: errors if timeoutMode is set without timeoutMS | ||
operations: | ||
- name: runCursorCommand | ||
object: *db | ||
arguments: | ||
commandName: find | ||
command: { find: *collection } | ||
timeoutMode: cursorLifetime | ||
expectError: | ||
isClientError: true | ||
|
||
- description: error if timeoutMode is cursorLifetime and cursorType is tailableAwait | ||
operations: | ||
- name: runCursorCommand | ||
object: *db | ||
arguments: | ||
commandName: find | ||
command: { find: *collection } | ||
timeoutMode: cursorLifetime | ||
cursorType: tailableAwait | ||
expectError: | ||
isClientError: true | ||
|
||
# If timeoutMode is unset, it should default to CURSOR_LIFETIME and the time remaining after the find succeeds should be applied to the getMore | ||
- description: Non-tailable cursor lifetime remaining timeoutMS applied to getMore if timeoutMode is unset | ||
runOnRequirements: | ||
- serverless: forbid | ||
operations: | ||
# Block find/getMore for 15ms. | ||
- name: failPoint | ||
object: testRunner | ||
arguments: | ||
client: *failPointClient | ||
failPoint: | ||
configureFailPoint: failCommand | ||
mode: { times: 2 } | ||
data: | ||
failCommands: [find, getMore] | ||
blockConnection: true | ||
blockTimeMS: 60 | ||
# Run a find with timeoutMS less than double our failPoint blockTimeMS and | ||
# batchSize less than the total document count will cause a find and a getMore to be sent. | ||
# Both will block for 60ms so together they will go over the timeout. | ||
- name: runCursorCommand | ||
object: *db | ||
arguments: | ||
commandName: find | ||
timeoutMS: 100 | ||
command: { find: *collection, batchSize: 2 } | ||
prestonvasquez marked this conversation as resolved.
Show resolved
Hide resolved
|
||
expectError: | ||
isTimeoutError: true | ||
expectEvents: | ||
- client: *client | ||
events: | ||
- commandStartedEvent: | ||
commandName: find | ||
command: | ||
find: *collection | ||
maxTimeMS: { $$type: [int, long] } | ||
- commandStartedEvent: | ||
commandName: getMore | ||
command: | ||
getMore: { $$type: [int, long] } | ||
collection: *collection | ||
maxTimeMS: { $$exists: true } | ||
|
||
# If timeoutMode=ITERATION, timeoutMS applies separately to the initial find and the getMore on the cursor. Neither | ||
# command should have a maxTimeMS field. This is a failure test. The "find" inherits timeoutMS=100 and "getMore" | ||
# commands are blocked for 60ms, causing iteration to fail with a timeout error. | ||
- description: Non=tailable cursor iteration timeoutMS is refreshed for getMore if timeoutMode is iteration - failure | ||
runOnRequirements: | ||
- serverless: forbid | ||
operations: | ||
- name: failPoint | ||
object: testRunner | ||
arguments: | ||
client: *failPointClient | ||
failPoint: | ||
configureFailPoint: failCommand | ||
mode: { times: 1 } | ||
data: | ||
failCommands: ["getMore"] | ||
blockConnection: true | ||
blockTimeMS: 60 | ||
- name: runCursorCommand | ||
object: *db | ||
arguments: | ||
commandName: find | ||
command: { find: *collection, batchSize: 2 } | ||
timeoutMode: iteration | ||
timeoutMS: 100 | ||
batchSize: 2 | ||
expectError: | ||
isTimeoutError: true | ||
expectEvents: | ||
- client: *client | ||
events: | ||
- commandStartedEvent: | ||
commandName: find | ||
databaseName: *db | ||
command: | ||
find: *collection | ||
maxTimeMS: { $$exists: false } | ||
- commandStartedEvent: | ||
commandName: getMore | ||
databaseName: *db | ||
command: | ||
getMore: { $$type: ["int", "long"] } | ||
collection: *collection | ||
maxTimeMS: { $$exists: false } | ||
|
||
# The timeoutMS option should apply separately to the initial "find" and each getMore. This is a failure test. The | ||
# find inherits timeoutMS=100 from the collection and the getMore command blocks for 60ms, causing iteration to fail | ||
# with a timeout error. | ||
- description: Tailable cursor iteration timeoutMS is refreshed for getMore - failure | ||
prestonvasquez marked this conversation as resolved.
Show resolved
Hide resolved
|
||
runOnRequirements: | ||
- serverless: forbid | ||
operations: | ||
- name: failPoint | ||
object: testRunner | ||
arguments: | ||
client: *failPointClient | ||
failPoint: | ||
configureFailPoint: failCommand | ||
mode: { times: 1 } | ||
data: | ||
failCommands: ["getMore"] | ||
blockConnection: true | ||
blockTimeMS: 60 | ||
- name: dropCollection | ||
object: *db | ||
arguments: | ||
collection: &cappedCollection cappedCollection | ||
- name: createCollection | ||
object: *db | ||
arguments: | ||
collection: *cappedCollection | ||
capped: true | ||
size: 4096 | ||
max: 3 | ||
saveResultAsEntity: *cappedCollection | ||
- name: insertMany | ||
object: *cappedCollection | ||
arguments: | ||
documents: | ||
- { _id: 1, x: 11 } | ||
- { _id: 2, x: 22 } | ||
- name: createCommandCursor | ||
object: *db | ||
arguments: | ||
commandName: find | ||
command: { find: *cappedCollection, batchSize: 1, tailable: true } | ||
timeoutMode: iteration | ||
timeoutMS: 100 | ||
batchSize: 1 | ||
cursorType: tailable | ||
saveResultAsEntity: &tailableCursor tailableCursor | ||
# Iterate the cursor twice: the first iteration will return the document from the batch in the find and the | ||
# second will do a getMore. | ||
- name: iterateUntilDocumentOrError | ||
object: *tailableCursor | ||
- name: iterateUntilDocumentOrError | ||
object: *tailableCursor | ||
expectError: | ||
isTimeoutError: true | ||
expectEvents: | ||
- client: *client | ||
events: | ||
- commandStartedEvent: | ||
commandName: drop | ||
- commandStartedEvent: | ||
commandName: create | ||
- commandStartedEvent: | ||
commandName: insert | ||
- commandStartedEvent: | ||
commandName: find | ||
databaseName: *db | ||
command: | ||
find: *cappedCollection | ||
tailable: true | ||
awaitData: { $$exists: false } | ||
maxTimeMS: { $$exists: false } | ||
- commandStartedEvent: | ||
commandName: getMore | ||
databaseName: *db | ||
command: | ||
getMore: { $$type: ["int", "long"] } | ||
collection: *cappedCollection | ||
maxTimeMS: { $$exists: false } | ||
|
||
# The timeoutMS value should be refreshed for getMore's. This is a failure test. The find inherits timeoutMS=10 from | ||
# the collection and the getMore blocks for 15ms, causing iteration to fail with a timeout error. | ||
prestonvasquez marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- description: Tailable cursor awaitData iteration timeoutMS is refreshed for getMore - failure | ||
prestonvasquez marked this conversation as resolved.
Show resolved
Hide resolved
|
||
runOnRequirements: | ||
- serverless: forbid | ||
operations: | ||
- name: failPoint | ||
object: testRunner | ||
arguments: | ||
client: *failPointClient | ||
failPoint: | ||
configureFailPoint: failCommand | ||
mode: { times: 1 } | ||
data: | ||
failCommands: ["getMore"] | ||
blockConnection: true | ||
blockTimeMS: 60 | ||
- name: dropCollection | ||
object: *db | ||
arguments: | ||
collection: &cappedCollection cappedCollection | ||
- name: createCollection | ||
object: *db | ||
arguments: | ||
collection: *cappedCollection | ||
capped: true | ||
size: 4096 | ||
max: 3 | ||
saveResultAsEntity: *cappedCollection | ||
- name: insertMany | ||
prestonvasquez marked this conversation as resolved.
Show resolved
Hide resolved
|
||
object: *cappedCollection | ||
arguments: | ||
documents: [ { foo: bar }, { fizz: buzz } ] | ||
- name: createCommandCursor | ||
object: *db | ||
arguments: | ||
command: { find: *cappedCollection, tailable: true, awaitData: true } | ||
cursorType: tailableAwait | ||
batchSize: 1 | ||
saveResultAsEntity: &tailableCursor tailableCursor | ||
# Iterate twice to force a getMore. | ||
- name: iterateUntilDocumentOrError | ||
object: *tailableCursor | ||
- name: iterateUntilDocumentOrError | ||
object: *tailableCursor | ||
expectError: | ||
isTimeoutError: true | ||
expectEvents: | ||
- client: *client | ||
events: | ||
- commandStartedEvent: | ||
commandName: drop | ||
- commandStartedEvent: | ||
commandName: create | ||
- commandStartedEvent: | ||
commandName: insert | ||
- commandStartedEvent: | ||
commandName: find | ||
databaseName: *db | ||
command: | ||
find: *cappedCollection | ||
tailable: true | ||
awaitData: true | ||
maxTimeMS: { $$exists: true } | ||
- commandStartedEvent: | ||
commandName: getMore | ||
databaseName: *db | ||
command: | ||
getMore: { $$type: ["int", "long"] } | ||
collection: *cappedCollection |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.