Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
{
"description": "causal consistency bulkWrite include afterClusterTime",
"schemaVersion": "1.3",
"runOnRequirements": [
{
"minServerVersion": "8.0",
"topologies": [
"replicaset",
"sharded",
"load-balanced"
]
}
],
"createEntities": [
{
"client": {
"id": "client0",
"useMultipleMongoses": false,
"uriOptions": {
"retryWrites": false
},
"observeEvents": [
"commandStartedEvent"
]
}
},
{
"database": {
"id": "database0",
"client": "client0",
"databaseName": "causal-consistency-tests"
}
},
{
"collection": {
"id": "collection0",
"database": "database0",
"collectionName": "test"
}
},
{
"session": {
"id": "session0",
"client": "client0",
"sessionOptions": {
"causalConsistency": true
}
}
}
],
"initialData": [
{
"collectionName": "test",
"databaseName": "causal-consistency-tests",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
}
]
}
],
"tests": [
{
"description": "clientBulkWrite includes afterClusterTime in causally consistent session",
"operations": [
{
"name": "find",
"object": "collection0",
"arguments": {
"session": "session0",
"filter": {
"_id": 1
}
},
"expectResult": [
{
"_id": 1,
"x": 11
}
]
},
{
"name": "clientBulkWrite",
"object": "client0",
"arguments": {
"session": "session0",
"models": [
{
"insertOne": {
"namespace": "causal-consistency-tests.test",
"document": {
"_id": 4
}
}
}
]
}
}
],
"expectEvents": [
{
"client": "client0",
"events": [
{
"commandStartedEvent": {
"commandName": "find",
"command": {
"find": "test",
"readConcern": {
"$$exists": false
},
"lsid": {
"$$sessionLsid": "session0"
}
}
}
},
{
"commandStartedEvent": {
"commandName": "bulkWrite",
"command": {
"bulkWrite": 1,
"lsid": {
"$$sessionLsid": "session0"
},
"readConcern": {
"afterClusterTime": {
"$$exists": true
},
"level": {
"$$exists": false
}
}
}
}
}
]
}
]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
description: "causal consistency bulkWrite include afterClusterTime"

schemaVersion: "1.3"

runOnRequirements:
- minServerVersion: "8.0"
topologies: [replicaset, sharded, load-balanced]

createEntities:
- client:
id: &client0 client0
useMultipleMongoses: false
uriOptions:
retryWrites: false
observeEvents: [commandStartedEvent]
- database:
id: &database0 database0
client: *client0
databaseName: &databaseName causal-consistency-tests
- collection:
id: &collection0 collection0
database: *database0
collectionName: &collectionName test
- session:
id: &session0 session0
client: *client0
sessionOptions:
causalConsistency: true

initialData:
- collectionName: *collectionName
databaseName: *databaseName
documents:
- { _id: 1, x: 11 }
- { _id: 2, x: 22 }
- { _id: 3, x: 33 }

# In a causally consistent session, once an operationTime has been established by a prior
# operation, subsequent write commands MUST include readConcern.afterClusterTime so the
# server can apply the write causally after the previously-observed data.

tests:
- description: "clientBulkWrite includes afterClusterTime in causally consistent session"
operations:
- name: find
object: *collection0
arguments:
session: *session0
filter: { _id: 1 }
expectResult: [{ _id: 1, x: 11 }]
- name: clientBulkWrite
object: *client0
arguments:
session: *session0
models:
- insertOne:
namespace: causal-consistency-tests.test
document: { _id: 4 }
expectEvents:
- client: *client0
events:
- commandStartedEvent:
commandName: find
command:
find: *collectionName
readConcern: { $$exists: false }
lsid: { $$sessionLsid: *session0 }
- commandStartedEvent:
commandName: bulkWrite
command:
bulkWrite: 1
lsid: { $$sessionLsid: *session0 }
readConcern:
afterClusterTime: { $$exists: true }
level: { $$exists: false }
Loading
Loading