| 1 | { |
| 2 | "runOn": [ |
| 3 | { |
| 4 | "minServerVersion": "4.0", |
| 5 | "topology": [ |
| 6 | "replicaset" |
| 7 | ] |
| 8 | }, |
| 9 | { |
| 10 | "minServerVersion": "4.1.7", |
| 11 | "topology": [ |
| 12 | "sharded", |
| 13 | "load-balanced" |
| 14 | ] |
| 15 | } |
| 16 | ], |
| 17 | "data": [ |
| 18 | { |
| 19 | "_id": 1, |
| 20 | "x": 11 |
| 21 | } |
| 22 | ], |
| 23 | "tests": [ |
| 24 | { |
| 25 | "description": "InsertMany succeeds after PrimarySteppedDown", |
| 26 | "failPoint": { |
| 27 | "configureFailPoint": "failCommand", |
| 28 | "mode": { |
| 29 | "times": 1 |
| 30 | }, |
| 31 | "data": { |
| 32 | "failCommands": [ |
| 33 | "insert" |
| 34 | ], |
| 35 | "errorCode": 189, |
| 36 | "errorLabels": [ |
| 37 | "RetryableWriteError" |
| 38 | ] |
| 39 | } |
| 40 | }, |
| 41 | "operation": { |
| 42 | "name": "insertMany", |
| 43 | "arguments": { |
| 44 | "documents": [ |
| 45 | { |
| 46 | "_id": 2, |
| 47 | "x": 22 |
| 48 | }, |
| 49 | { |
| 50 | "_id": 3, |
| 51 | "x": 33 |
| 52 | } |
| 53 | ], |
| 54 | "options": { |
| 55 | "ordered": true |
| 56 | } |
| 57 | } |
| 58 | }, |
| 59 | "outcome": { |
| 60 | "result": { |
| 61 | "insertedIds": { |
| 62 | "0": 2, |
| 63 | "1": 3 |
| 64 | } |
| 65 | }, |
| 66 | "collection": { |
| 67 | "data": [ |
| 68 | { |
| 69 | "_id": 1, |
| 70 | "x": 11 |
| 71 | }, |
| 72 | { |
| 73 | "_id": 2, |
| 74 | "x": 22 |
| 75 | }, |
| 76 | { |
| 77 | "_id": 3, |
| 78 | "x": 33 |
| 79 | } |
| 80 | ] |
| 81 | } |
| 82 | } |
| 83 | }, |
| 84 | { |
| 85 | "description": "InsertMany succeeds after WriteConcernError ShutdownInProgress", |
| 86 | "failPoint": { |
| 87 | "configureFailPoint": "failCommand", |
| 88 | "mode": { |
| 89 | "times": 1 |
| 90 | }, |
| 91 | "data": { |
| 92 | "failCommands": [ |
| 93 | "insert" |
| 94 | ], |
| 95 | "writeConcernError": { |
| 96 | "code": 91, |
| 97 | "errmsg": "Replication is being shut down", |
| 98 | "errorLabels": [ |
| 99 | "RetryableWriteError" |
| 100 | ] |
| 101 | } |
| 102 | } |
| 103 | }, |
| 104 | "operation": { |
| 105 | "name": "insertMany", |
| 106 | "arguments": { |
| 107 | "documents": [ |
| 108 | { |
| 109 | "_id": 2, |
| 110 | "x": 22 |
| 111 | }, |
| 112 | { |
| 113 | "_id": 3, |
| 114 | "x": 33 |
| 115 | } |
| 116 | ], |
| 117 | "options": { |
| 118 | "ordered": true |
| 119 | } |
| 120 | } |
| 121 | }, |
| 122 | "outcome": { |
| 123 | "result": { |
| 124 | "insertedIds": { |
| 125 | "0": 2, |
| 126 | "1": 3 |
| 127 | } |
| 128 | }, |
| 129 | "collection": { |
| 130 | "data": [ |
| 131 | { |
| 132 | "_id": 1, |
| 133 | "x": 11 |
| 134 | }, |
| 135 | { |
| 136 | "_id": 2, |
| 137 | "x": 22 |
| 138 | }, |
| 139 | { |
| 140 | "_id": 3, |
| 141 | "x": 33 |
| 142 | } |
| 143 | ] |
| 144 | } |
| 145 | } |
| 146 | }, |
| 147 | { |
| 148 | "description": "InsertMany fails with a RetryableWriteError label after two connection failures", |
| 149 | "failPoint": { |
| 150 | "configureFailPoint": "failCommand", |
| 151 | "mode": { |
| 152 | "times": 2 |
| 153 | }, |
| 154 | "data": { |
| 155 | "failCommands": [ |
| 156 | "insert" |
| 157 | ], |
| 158 | "closeConnection": true |
| 159 | } |
| 160 | }, |
| 161 | "operation": { |
| 162 | "name": "insertMany", |
| 163 | "arguments": { |
| 164 | "documents": [ |
| 165 | { |
| 166 | "_id": 2, |
| 167 | "x": 22 |
| 168 | }, |
| 169 | { |
| 170 | "_id": 3, |
| 171 | "x": 33 |
| 172 | } |
| 173 | ], |
| 174 | "options": { |
| 175 | "ordered": true |
| 176 | } |
| 177 | } |
| 178 | }, |
| 179 | "outcome": { |
| 180 | "error": true, |
| 181 | "result": { |
| 182 | "errorLabelsContain": [ |
| 183 | "RetryableWriteError" |
| 184 | ] |
| 185 | }, |
| 186 | "collection": { |
| 187 | "data": [ |
| 188 | { |
| 189 | "_id": 1, |
| 190 | "x": 11 |
| 191 | } |
| 192 | ] |
| 193 | } |
| 194 | } |
| 195 | } |
| 196 | ] |
| 197 | } |