-
Notifications
You must be signed in to change notification settings - Fork 244
DRIVERS-2985: Allow on-demand client metadata updates after MongoClient initialization. #1798
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
Open
vbabanin
wants to merge
24
commits into
mongodb:master
Choose a base branch
from
vbabanin:DRIVERS-2985
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
026c92b
Update spec to allow on-demand client metadata updates for instantiat…
vbabanin a9eddb4
Use MongoClient terminology.
vbabanin 324019d
Add prose tests.
vbabanin ab28ac3
Merge branch 'master' into DRIVERS-2985
vbabanin 03b5c1d
Add prose tests.
vbabanin 450528c
Change wording.
vbabanin 5ce8b92
Replace phrase for correctness.
vbabanin c6a042b
Add parametrized test-cases.
vbabanin e02503b
Disallow creating new connections solely to transfer updated metadata.
vbabanin 1faef56
Split saving of intercepted client document into a distinct step.
vbabanin 8fc6f1c
Update source/mongodb-handshake/handshake.md
vbabanin c572c4d
Revert "during MongoClient initialization".
vbabanin 0b7fbfa
Remove "MAY" from prose tests.
vbabanin dfde2d1
Add additional test-cases.
vbabanin 9f58bfb
Merge branch 'master' into DRIVERS-2985
vbabanin b4a4b0e
Merge branch 'master' into DRIVERS-2985
vbabanin 4be80aa
Add API guidance.
vbabanin f0315f4
Remove redundant assertions.
vbabanin da284da
Add unified-tests.
vbabanin 72f1150
Update changelog.
vbabanin ae795a6
Fix changelog.
vbabanin a34752b
Rename test files.
vbabanin 43dea26
Fix database name.
vbabanin 944329d
Add commandName "ping" to runCommand arguments.
vbabanin 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
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
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
100 changes: 100 additions & 0 deletions
100
source/mongodb-handshake/tests/unified/metadata-not-propagated.json
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,100 @@ | ||
{ | ||
"description": "client metadata is not propagated to the server", | ||
"schemaVersion": "1.9", | ||
"runOnRequirements": [ | ||
{ | ||
"minServerVersion": "6.0" | ||
} | ||
], | ||
"createEntities": [ | ||
{ | ||
"client": { | ||
"id": "client", | ||
"observeEvents": [ | ||
"commandSucceededEvent", | ||
"commandFailedEvent", | ||
"connectionClosedEvent", | ||
"connectionCreatedEvent" | ||
] | ||
} | ||
}, | ||
{ | ||
"database": { | ||
"id": "database", | ||
"client": "client", | ||
"databaseName": "test" | ||
} | ||
} | ||
], | ||
"tests": [ | ||
{ | ||
"description": "metadata append does not create new connections or close existing ones and no hello command is sent", | ||
"operations": [ | ||
{ | ||
"name": "runCommand", | ||
"object": "database", | ||
"arguments": { | ||
"commandName": "ping", | ||
"command": { | ||
"ping": 1 | ||
} | ||
}, | ||
"expectResult": { | ||
"ok": 1 | ||
} | ||
}, | ||
{ | ||
"name": "appendMetadata", | ||
"object": "client", | ||
"arguments": { | ||
"driverInfoOptions": { | ||
"name": "framework", | ||
"version": "2.0", | ||
"platform": "Framework Platform" | ||
} | ||
} | ||
}, | ||
{ | ||
"name": "runCommand", | ||
"object": "database", | ||
"arguments": { | ||
"commandName": "ping", | ||
"command": { | ||
"ping": 1 | ||
} | ||
}, | ||
"expectResult": { | ||
"ok": 1 | ||
} | ||
} | ||
], | ||
"expectEvents": [ | ||
{ | ||
"client": "client", | ||
"eventType": "cmap", | ||
"events": [ | ||
{ | ||
"connectionCreatedEvent": {} | ||
} | ||
] | ||
}, | ||
{ | ||
"client": "client", | ||
"eventType": "command", | ||
"events": [ | ||
{ | ||
"commandSucceededEvent": { | ||
"commandName": "ping" | ||
} | ||
}, | ||
{ | ||
"commandSucceededEvent": { | ||
"commandName": "ping" | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} |
58 changes: 58 additions & 0 deletions
58
source/mongodb-handshake/tests/unified/metadata-not-propagated.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,58 @@ | ||
description: client metadata is not propagated to the server | ||
schemaVersion: '1.9' | ||
runOnRequirements: | ||
- minServerVersion: '6.0' | ||
createEntities: | ||
- client: | ||
id: &client client | ||
observeEvents: | ||
- commandSucceededEvent | ||
- commandFailedEvent | ||
- connectionClosedEvent | ||
- connectionCreatedEvent | ||
- database: | ||
id: &database database | ||
client: *client | ||
databaseName: test | ||
tests: | ||
# Test that appending metadata after `MongoClient` initialization does not close existing | ||
# connections, create new ones, and that no new `hello` command is sent. | ||
- description: metadata append does not create new connections or close existing ones and no hello command is sent | ||
operations: | ||
- name: runCommand | ||
object: *database | ||
arguments: | ||
commandName: ping | ||
command: | ||
ping: 1 | ||
expectResult: | ||
ok: 1 | ||
- name: appendMetadata | ||
object: *client | ||
arguments: | ||
driverInfoOptions: | ||
name: framework | ||
version: '2.0' | ||
platform: Framework Platform | ||
- name: runCommand | ||
object: *database | ||
arguments: | ||
commandName: ping | ||
command: | ||
ping: 1 | ||
expectResult: | ||
ok: 1 | ||
expectEvents: | ||
- client: *client | ||
eventType: cmap | ||
events: | ||
# Expect only one connection to be created for the first 'ping' command. | ||
- connectionCreatedEvent: { } | ||
- client: *client | ||
eventType: command | ||
events: | ||
- commandSucceededEvent: | ||
commandName: ping | ||
- commandSucceededEvent: | ||
commandName: ping | ||
|
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
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.