1{ 2 "runOn": [ 3 { 4 "minServerVersion": "4.1.6", 5 "topology": [ 6 "replicaset" 7 ] 8 }, 9 { 10 "minServerVersion": "4.1.8", 11 "topology": [ 12 "sharded" 13 ] 14 } 15 ], 16 "database_name": "withTransaction-tests", 17 "collection_name": "test", 18 "data": [], 19 "tests": [ 20 { 21 "description": "transaction is retried after commitTransaction TransientTransactionError (PreparedTransactionInProgress)", 22 "failPoint": { 23 "configureFailPoint": "failCommand", 24 "mode": { 25 "times": 2 26 }, 27 "data": { 28 "failCommands": [ 29 "commitTransaction" 30 ], 31 "errorCode": 267, 32 "closeConnection": false 33 } 34 }, 35 "operations": [ 36 { 37 "name": "withTransaction", 38 "object": "session0", 39 "arguments": { 40 "callback": { 41 "operations": [ 42 { 43 "name": "insertOne", 44 "object": "collection", 45 "arguments": { 46 "session": "session0", 47 "document": { 48 "_id": 1 49 } 50 }, 51 "result": { 52 "insertedId": 1 53 } 54 } 55 ] 56 } 57 } 58 } 59 ], 60 "expectations": [ 61 { 62 "command_started_event": { 63 "command": { 64 "insert": "test", 65 "documents": [ 66 { 67 "_id": 1 68 } 69 ], 70 "ordered": true, 71 "lsid": "session0", 72 "txnNumber": { 73 "$numberLong": "1" 74 }, 75 "startTransaction": true, 76 "autocommit": false, 77 "readConcern": null, 78 "writeConcern": null 79 }, 80 "command_name": "insert", 81 "database_name": "withTransaction-tests" 82 } 83 }, 84 { 85 "command_started_event": { 86 "command": { 87 "commitTransaction": 1, 88 "lsid": "session0", 89 "txnNumber": { 90 "$numberLong": "1" 91 }, 92 "autocommit": false, 93 "readConcern": null, 94 "startTransaction": null, 95 "writeConcern": null 96 }, 97 "command_name": "commitTransaction", 98 "database_name": "admin" 99 } 100 }, 101 { 102 "command_started_event": { 103 "command": { 104 "insert": "test", 105 "documents": [ 106 { 107 "_id": 1 108 } 109 ], 110 "ordered": true, 111 "lsid": "session0", 112 "readConcern": { 113 "afterClusterTime": 42 114 }, 115 "txnNumber": { 116 "$numberLong": "2" 117 }, 118 "startTransaction": true, 119 "autocommit": false, 120 "writeConcern": null 121 }, 122 "command_name": "insert", 123 "database_name": "withTransaction-tests" 124 } 125 }, 126 { 127 "command_started_event": { 128 "command": { 129 "commitTransaction": 1, 130 "lsid": "session0", 131 "txnNumber": { 132 "$numberLong": "2" 133 }, 134 "autocommit": false, 135 "readConcern": null, 136 "startTransaction": null, 137 "writeConcern": null 138 }, 139 "command_name": "commitTransaction", 140 "database_name": "admin" 141 } 142 }, 143 { 144 "command_started_event": { 145 "command": { 146 "insert": "test", 147 "documents": [ 148 { 149 "_id": 1 150 } 151 ], 152 "ordered": true, 153 "lsid": "session0", 154 "readConcern": { 155 "afterClusterTime": 42 156 }, 157 "txnNumber": { 158 "$numberLong": "3" 159 }, 160 "startTransaction": true, 161 "autocommit": false, 162 "writeConcern": null 163 }, 164 "command_name": "insert", 165 "database_name": "withTransaction-tests" 166 } 167 }, 168 { 169 "command_started_event": { 170 "command": { 171 "commitTransaction": 1, 172 "lsid": "session0", 173 "txnNumber": { 174 "$numberLong": "3" 175 }, 176 "autocommit": false, 177 "readConcern": null, 178 "startTransaction": null, 179 "writeConcern": null 180 }, 181 "command_name": "commitTransaction", 182 "database_name": "admin" 183 } 184 } 185 ], 186 "outcome": { 187 "collection": { 188 "data": [ 189 { 190 "_id": 1 191 } 192 ] 193 } 194 } 195 } 196 ] 197} 198