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