| 1 |
runOn: |
| 2 |
- |
| 3 |
minServerVersion: "4.0" |
| 4 |
topology: ["single", "replicaset"] |
| 5 |
- |
| 6 |
minServerVersion: "4.1.7" |
| 7 |
topology: ["sharded", "load-balanced"] |
| 8 |
|
| 9 |
database_name: &database_name "retryable-reads-tests" |
| 10 |
collection_name: &collection_name "coll" |
| 11 |
|
| 12 |
data: |
| 13 |
- {_id: 1, x: 11} |
| 14 |
- {_id: 2, x: 22} |
| 15 |
- {_id: 3, x: 33} |
| 16 |
- {_id: 4, x: 44} |
| 17 |
- {_id: 5, x: 55} |
| 18 |
|
| 19 |
tests: |
| 20 |
- |
| 21 |
description: "FindOne succeeds after InterruptedAtShutdown" |
| 22 |
failPoint: &failCommand_failPoint |
| 23 |
configureFailPoint: failCommand |
| 24 |
mode: { times: 1 } |
| 25 |
data: { failCommands: [find], errorCode: 11600 } |
| 26 |
operations: |
| 27 |
- &retryable_operation_succeeds |
| 28 |
<<: &retryable_operation |
| 29 |
name: findOne |
| 30 |
object: collection |
| 31 |
arguments: |
| 32 |
filter: {_id: 1} |
| 33 |
result: {_id: 1, x: 11} |
| 34 |
expectations: |
| 35 |
- &retryable_command_started_event |
| 36 |
command_started_event: |
| 37 |
command: |
| 38 |
find: *collection_name |
| 39 |
filter: {_id: 1} |
| 40 |
database_name: *database_name |
| 41 |
- *retryable_command_started_event |
| 42 |
- |
| 43 |
description: "FindOne succeeds after InterruptedDueToReplStateChange" |
| 44 |
failPoint: |
| 45 |
<<: *failCommand_failPoint |
| 46 |
data: { failCommands: [find], errorCode: 11602 } |
| 47 |
operations: [*retryable_operation_succeeds] |
| 48 |
expectations: |
| 49 |
- *retryable_command_started_event |
| 50 |
- *retryable_command_started_event |
| 51 |
- |
| 52 |
description: "FindOne succeeds after NotWritablePrimary" |
| 53 |
failPoint: |
| 54 |
<<: *failCommand_failPoint |
| 55 |
data: { failCommands: [find], errorCode: 10107 } |
| 56 |
operations: [*retryable_operation_succeeds] |
| 57 |
expectations: |
| 58 |
- *retryable_command_started_event |
| 59 |
- *retryable_command_started_event |
| 60 |
- |
| 61 |
description: "FindOne succeeds after NotPrimaryNoSecondaryOk" |
| 62 |
failPoint: |
| 63 |
<<: *failCommand_failPoint |
| 64 |
data: { failCommands: [find], errorCode: 13435 } |
| 65 |
operations: [*retryable_operation_succeeds] |
| 66 |
expectations: |
| 67 |
- *retryable_command_started_event |
| 68 |
- *retryable_command_started_event |
| 69 |
- |
| 70 |
description: "FindOne succeeds after NotPrimaryOrSecondary" |
| 71 |
failPoint: |
| 72 |
<<: *failCommand_failPoint |
| 73 |
data: { failCommands: [find], errorCode: 13436 } |
| 74 |
operations: [*retryable_operation_succeeds] |
| 75 |
expectations: |
| 76 |
- *retryable_command_started_event |
| 77 |
- *retryable_command_started_event |
| 78 |
- |
| 79 |
description: "FindOne succeeds after PrimarySteppedDown" |
| 80 |
failPoint: |
| 81 |
<<: *failCommand_failPoint |
| 82 |
data: { failCommands: [find], errorCode: 189 } |
| 83 |
operations: [*retryable_operation_succeeds] |
| 84 |
expectations: |
| 85 |
- *retryable_command_started_event |
| 86 |
- *retryable_command_started_event |
| 87 |
- |
| 88 |
description: "FindOne succeeds after ShutdownInProgress" |
| 89 |
failPoint: |
| 90 |
<<: *failCommand_failPoint |
| 91 |
data: { failCommands: [find], errorCode: 91 } |
| 92 |
operations: [*retryable_operation_succeeds] |
| 93 |
expectations: |
| 94 |
- *retryable_command_started_event |
| 95 |
- *retryable_command_started_event |
| 96 |
- |
| 97 |
description: "FindOne succeeds after HostNotFound" |
| 98 |
failPoint: |
| 99 |
<<: *failCommand_failPoint |
| 100 |
data: { failCommands: [find], errorCode: 7 } |
| 101 |
operations: [*retryable_operation_succeeds] |
| 102 |
expectations: |
| 103 |
- *retryable_command_started_event |
| 104 |
- *retryable_command_started_event |
| 105 |
- |
| 106 |
description: "FindOne succeeds after HostUnreachable" |
| 107 |
failPoint: |
| 108 |
<<: *failCommand_failPoint |
| 109 |
data: { failCommands: [find], errorCode: 6 } |
| 110 |
operations: [*retryable_operation_succeeds] |
| 111 |
expectations: |
| 112 |
- *retryable_command_started_event |
| 113 |
- *retryable_command_started_event |
| 114 |
- |
| 115 |
description: "FindOne succeeds after NetworkTimeout" |
| 116 |
failPoint: |
| 117 |
<<: *failCommand_failPoint |
| 118 |
data: { failCommands: [find], errorCode: 89 } |
| 119 |
operations: [*retryable_operation_succeeds] |
| 120 |
expectations: |
| 121 |
- *retryable_command_started_event |
| 122 |
- *retryable_command_started_event |
| 123 |
- |
| 124 |
description: "FindOne succeeds after SocketException" |
| 125 |
failPoint: |
| 126 |
<<: *failCommand_failPoint |
| 127 |
data: { failCommands: [find], errorCode: 9001 } |
| 128 |
operations: [*retryable_operation_succeeds] |
| 129 |
expectations: |
| 130 |
- *retryable_command_started_event |
| 131 |
- *retryable_command_started_event |
| 132 |
- |
| 133 |
description: "FindOne fails after two NotWritablePrimary errors" |
| 134 |
failPoint: |
| 135 |
<<: *failCommand_failPoint |
| 136 |
mode: { times: 2 } |
| 137 |
data: { failCommands: [find], errorCode: 10107 } |
| 138 |
operations: |
| 139 |
- &retryable_operation_fails |
| 140 |
<<: *retryable_operation |
| 141 |
error: true |
| 142 |
expectations: |
| 143 |
- *retryable_command_started_event |
| 144 |
- *retryable_command_started_event |
| 145 |
- |
| 146 |
description: "FindOne fails after NotWritablePrimary when retryReads is false" |
| 147 |
clientOptions: |
| 148 |
retryReads: false |
| 149 |
failPoint: |
| 150 |
<<: *failCommand_failPoint |
| 151 |
data: { failCommands: [find], errorCode: 10107 } |
| 152 |
operations: [*retryable_operation_fails] |
| 153 |
expectations: |
| 154 |
- *retryable_command_started_event |