1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119
|
description: "implicit sessions default causal consistency"
schemaVersion: "1.3"
runOnRequirements:
- minServerVersion: "4.2"
topologies: [replicaset, sharded, load-balanced]
createEntities:
- client:
id: &client0 client0
useMultipleMongoses: false
observeEvents: [commandStartedEvent]
- database:
id: &database0 database0
client: *client0
databaseName: &databaseName implicit-cc-tests
- collection:
id: &collectionDefault collectionDefault
database: *database0
collectionName: &collectionNameDefault coll-default
- collection:
id: &collectionSnapshot collectionSnapshot
database: *database0
collectionName: &collectionNameSnapshot coll-snapshot
collectionOptions:
readConcern: { level: snapshot }
- collection:
id: &collectionlinearizable collectionlinearizable
database: *database0
collectionName: &collectionNamelinearizable coll-linearizable
collectionOptions:
readConcern: { level: linearizable }
initialData:
- collectionName: *collectionNameDefault
databaseName: *databaseName
documents:
- { _id: 1, x: default }
- collectionName: *collectionNameSnapshot
databaseName: *databaseName
documents:
- { _id: 1, x: snapshot }
- collectionName: *collectionNamelinearizable
databaseName: *databaseName
documents:
- { _id: 1, x: linearizable }
tests:
- description: "readConcern is not sent on retried read in implicit session when readConcern level is not specified"
operations:
- &failPointCommand
name: failPoint
object: testRunner
arguments:
client: *client0
failPoint:
configureFailPoint: failCommand
mode: { times: 1 }
data:
failCommands: [find]
errorCode: 11600 #InterruptedAtShutdown
- name: find
object: *collectionDefault
arguments:
filter: {}
expectResult: [{ _id: 1, x: default }]
expectEvents:
- client: *client0
events:
- commandStartedEvent: &commandStartedEventDefault
command:
find: *collectionNameDefault
filter: {}
readConcern: { $$exists: false }
databaseName: *databaseName
- commandStartedEvent: *commandStartedEventDefault
- description: "afterClusterTime is not sent on retried read in implicit session when readConcern level is snapshot"
runOnRequirements:
- minServerVersion: "5.0"
operations:
- *failPointCommand
- name: find
object: *collectionSnapshot
arguments:
filter: {}
expectResult: [{ _id: 1, x: snapshot }]
expectEvents:
- client: *client0
events:
- commandStartedEvent: &commandStartedEventSnapshot
command:
find: *collectionNameSnapshot
filter: {}
readConcern:
{ level: snapshot, afterClusterTime: { $$exists: false } }
databaseName: *databaseName
- commandStartedEvent: *commandStartedEventSnapshot
- description: "afterClusterTime is not sent on retried read in implicit session when readConcern level is linearizable"
operations:
- *failPointCommand
- name: find
object: *collectionlinearizable
arguments:
filter: {}
expectResult: [{ _id: 1, x: linearizable }]
expectEvents:
- client: *client0
events:
- commandStartedEvent: &commandStartedEventLinearizable
command:
find: *collectionNamelinearizable
filter: {}
readConcern:
{ level: linearizable, afterClusterTime: { $$exists: false } }
databaseName: *databaseName
- commandStartedEvent: *commandStartedEventLinearizable
|