...
1description: "do not retry read in a transaction"
2
3schemaVersion: "1.4"
4
5runOnRequirements:
6 - minServerVersion: "4.0.0"
7 topologies: [ replicaset ]
8 - minServerVersion: "4.2.0"
9 topologies: [ sharded, load-balanced ]
10
11createEntities:
12 - client:
13 id: &client0 client0
14 useMultipleMongoses: false
15 observeEvents: [commandStartedEvent]
16 uriOptions: { retryReads: true }
17 - database:
18 id: &database0 database0
19 client: *client0
20 databaseName: &databaseName retryable-read-in-transaction-test
21 - collection:
22 id: &collection0 collection0
23 database: *database0
24 collectionName: &collectionName coll
25 - session:
26 id: &session0 session0
27 client: *client0
28
29tests:
30 - description: "find does not retry in a transaction"
31 operations:
32
33 - name: startTransaction
34 object: *session0
35
36 - name: failPoint # fail the following find command
37 object: testRunner
38 arguments:
39 client: *client0
40 failPoint:
41 configureFailPoint: failCommand
42 mode: { times: 1 }
43 data:
44 failCommands: [find]
45 closeConnection: true
46
47 - name: find
48 object: *collection0
49 arguments:
50 filter: {}
51 session: *session0
52 expectError:
53 isError: true
54 errorLabelsContain: ["TransientTransactionError"]
55 expectEvents:
56 - client: *client0
57 events:
58 - commandStartedEvent:
59 command:
60 find: *collectionName
61 filter: {}
62 startTransaction: true
63 commandName: find
64 databaseName: *databaseName
View as plain text