...

Text file src/go.mongodb.org/mongo-driver/testdata/retryable-reads/find-serverErrors.yml

Documentation: go.mongodb.org/mongo-driver/testdata/retryable-reads

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

View as plain text