| 1 | runOn: |
| 2 | - |
| 3 | minServerVersion: "3.6" |
| 4 | topology: ["replicaset"] |
| 5 | |
| 6 | data: |
| 7 | - { _id: 1, x: 11 } |
| 8 | - { _id: 2, x: 22 } |
| 9 | |
| 10 | tests: |
| 11 | - |
| 12 | description: "FindOneAndDelete is committed on first attempt" |
| 13 | failPoint: |
| 14 | configureFailPoint: onPrimaryTransactionalWrite |
| 15 | mode: { times: 1 } |
| 16 | operation: |
| 17 | name: "findOneAndDelete" |
| 18 | arguments: |
| 19 | filter: { x: { $gte: 11 }} |
| 20 | sort: { x: 1 } |
| 21 | outcome: |
| 22 | result: { _id: 1, x: 11 } |
| 23 | collection: |
| 24 | data: |
| 25 | - { _id: 2, x: 22 } |
| 26 | - |
| 27 | description: "FindOneAndDelete is not committed on first attempt" |
| 28 | failPoint: |
| 29 | configureFailPoint: onPrimaryTransactionalWrite |
| 30 | mode: { times: 1 } |
| 31 | data: { failBeforeCommitExceptionCode: 1 } |
| 32 | operation: |
| 33 | name: "findOneAndDelete" |
| 34 | arguments: |
| 35 | filter: { x: { $gte: 11 }} |
| 36 | sort: { x: 1 } |
| 37 | outcome: |
| 38 | result: { _id: 1, x: 11 } |
| 39 | collection: |
| 40 | data: |
| 41 | - { _id: 2, x: 22 } |
| 42 | - |
| 43 | description: "FindOneAndDelete is never committed" |
| 44 | failPoint: |
| 45 | configureFailPoint: onPrimaryTransactionalWrite |
| 46 | mode: { times: 2 } |
| 47 | data: { failBeforeCommitExceptionCode: 1 } |
| 48 | operation: |
| 49 | name: "findOneAndDelete" |
| 50 | arguments: |
| 51 | filter: { x: { $gte: 11 }} |
| 52 | sort: { x: 1 } |
| 53 | outcome: |
| 54 | error: true |
| 55 | collection: |
| 56 | data: |
| 57 | - { _id: 1, x: 11 } |
| 58 | - { _id: 2, x: 22 } |