| 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 | "_id": 2, |
| 24 | "x": 22 |
| 25 | } |
| 26 | ], |
| 27 | "tests": [ |
| 28 | { |
| 29 | "description": "DeleteOne succeeds after PrimarySteppedDown", |
| 30 | "failPoint": { |
| 31 | "configureFailPoint": "failCommand", |
| 32 | "mode": { |
| 33 | "times": 1 |
| 34 | }, |
| 35 | "data": { |
| 36 | "failCommands": [ |
| 37 | "delete" |
| 38 | ], |
| 39 | "errorCode": 189, |
| 40 | "errorLabels": [ |
| 41 | "RetryableWriteError" |
| 42 | ] |
| 43 | } |
| 44 | }, |
| 45 | "operation": { |
| 46 | "name": "deleteOne", |
| 47 | "arguments": { |
| 48 | "filter": { |
| 49 | "_id": 1 |
| 50 | } |
| 51 | } |
| 52 | }, |
| 53 | "outcome": { |
| 54 | "result": { |
| 55 | "deletedCount": 1 |
| 56 | }, |
| 57 | "collection": { |
| 58 | "data": [ |
| 59 | { |
| 60 | "_id": 2, |
| 61 | "x": 22 |
| 62 | } |
| 63 | ] |
| 64 | } |
| 65 | } |
| 66 | }, |
| 67 | { |
| 68 | "description": "DeleteOne succeeds after WriteConcernError ShutdownInProgress", |
| 69 | "failPoint": { |
| 70 | "configureFailPoint": "failCommand", |
| 71 | "mode": { |
| 72 | "times": 1 |
| 73 | }, |
| 74 | "data": { |
| 75 | "failCommands": [ |
| 76 | "delete" |
| 77 | ], |
| 78 | "writeConcernError": { |
| 79 | "code": 91, |
| 80 | "errmsg": "Replication is being shut down", |
| 81 | "errorLabels": [ |
| 82 | "RetryableWriteError" |
| 83 | ] |
| 84 | } |
| 85 | } |
| 86 | }, |
| 87 | "operation": { |
| 88 | "name": "deleteOne", |
| 89 | "arguments": { |
| 90 | "filter": { |
| 91 | "_id": 1 |
| 92 | } |
| 93 | } |
| 94 | }, |
| 95 | "outcome": { |
| 96 | "result": { |
| 97 | "deletedCount": 1 |
| 98 | }, |
| 99 | "collection": { |
| 100 | "data": [ |
| 101 | { |
| 102 | "_id": 2, |
| 103 | "x": 22 |
| 104 | } |
| 105 | ] |
| 106 | } |
| 107 | } |
| 108 | }, |
| 109 | { |
| 110 | "description": "DeleteOne fails with RetryableWriteError label after two connection failures", |
| 111 | "failPoint": { |
| 112 | "configureFailPoint": "failCommand", |
| 113 | "mode": { |
| 114 | "times": 2 |
| 115 | }, |
| 116 | "data": { |
| 117 | "failCommands": [ |
| 118 | "delete" |
| 119 | ], |
| 120 | "closeConnection": true |
| 121 | } |
| 122 | }, |
| 123 | "operation": { |
| 124 | "name": "deleteOne", |
| 125 | "arguments": { |
| 126 | "filter": { |
| 127 | "_id": 1 |
| 128 | } |
| 129 | } |
| 130 | }, |
| 131 | "outcome": { |
| 132 | "error": true, |
| 133 | "result": { |
| 134 | "errorLabelsContain": [ |
| 135 | "RetryableWriteError" |
| 136 | ] |
| 137 | }, |
| 138 | "collection": { |
| 139 | "data": [ |
| 140 | { |
| 141 | "_id": 1, |
| 142 | "x": 11 |
| 143 | }, |
| 144 | { |
| 145 | "_id": 2, |
| 146 | "x": 22 |
| 147 | } |
| 148 | ] |
| 149 | } |
| 150 | } |
| 151 | } |
| 152 | ] |
| 153 | } |