...

Text file src/go.mongodb.org/mongo-driver/testdata/retryable-reads/gridfs-download-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"
    10bucket_name: "fs"
    11
    12data:
    13    fs.files:
    14        -
    15            _id: { $oid : "000000000000000000000001" }
    16            length: 1
    17            chunkSize: 4
    18            uploadDate: { $date : "1970-01-01T00:00:00.000Z" }
    19            filename: abc
    20            metadata: {}
    21    fs.chunks:
    22        - { _id: { $oid: "000000000000000000000002" }, files_id: { $oid: "000000000000000000000001" }, n: 0, data: { $binary: { base64: "EQ==", subType: "00" } } }
    23
    24tests:
    25    -
    26        description: "Download succeeds after InterruptedAtShutdown"
    27        failPoint: &failCommand_failPoint
    28            configureFailPoint: failCommand
    29            mode: { times: 1 }
    30            data: { failCommands: [find], errorCode: 11600 }
    31        operations:
    32            - &retryable_operation
    33                name: download
    34                object: gridfsbucket
    35                arguments: { id: { "$oid" : "000000000000000000000001" } }
    36        expectations:
    37            - &retryable_command_started_event
    38                command_started_event:
    39                    command:
    40                        find: fs.files
    41                        filter: { _id: {$oid : "000000000000000000000001" }}
    42                    database_name: *database_name
    43            - *retryable_command_started_event
    44            - &find_chunks_command_started_event
    45                command_started_event:
    46                    command:
    47                        find: fs.chunks
    48                        filter: { files_id: {$oid : "000000000000000000000001" }}
    49                        sort: { n: 1 }
    50                    database_name: *database_name
    51    -
    52        description: "Download succeeds after InterruptedDueToReplStateChange"
    53        failPoint:
    54            <<: *failCommand_failPoint
    55            data: { failCommands: [find], errorCode: 11602 }
    56        operations: [*retryable_operation]
    57        expectations:
    58             - *retryable_command_started_event
    59             - *retryable_command_started_event
    60             - *find_chunks_command_started_event
    61    -
    62        description: "Download succeeds after NotWritablePrimary"
    63        failPoint:
    64            <<: *failCommand_failPoint
    65            data: { failCommands: [find], errorCode: 10107 }
    66        operations: [*retryable_operation]
    67        expectations:
    68             - *retryable_command_started_event
    69             - *retryable_command_started_event
    70             - *find_chunks_command_started_event
    71    -
    72        description: "Download succeeds after NotPrimaryNoSecondaryOk"
    73        failPoint:
    74            <<: *failCommand_failPoint
    75            data: { failCommands: [find], errorCode: 13435 }
    76        operations: [*retryable_operation]
    77        expectations:
    78             - *retryable_command_started_event
    79             - *retryable_command_started_event
    80             - *find_chunks_command_started_event
    81    -
    82        description: "Download succeeds after NotPrimaryOrSecondary"
    83        failPoint:
    84            <<: *failCommand_failPoint
    85            data: { failCommands: [find], errorCode: 13436 }
    86        operations: [*retryable_operation]
    87        expectations:
    88             - *retryable_command_started_event
    89             - *retryable_command_started_event
    90             - *find_chunks_command_started_event
    91    -
    92        description: "Download succeeds after PrimarySteppedDown"
    93        failPoint:
    94            <<: *failCommand_failPoint
    95            data: { failCommands: [find], errorCode: 189 }
    96        operations: [*retryable_operation]
    97        expectations:
    98             - *retryable_command_started_event
    99             - *retryable_command_started_event
   100             - *find_chunks_command_started_event
   101    -
   102        description: "Download succeeds after ShutdownInProgress"
   103        failPoint:
   104            <<: *failCommand_failPoint
   105            data: { failCommands: [find], errorCode: 91 }
   106        operations: [*retryable_operation]
   107        expectations:
   108             - *retryable_command_started_event
   109             - *retryable_command_started_event
   110             - *find_chunks_command_started_event
   111    -
   112        description: "Download succeeds after HostNotFound"
   113        failPoint:
   114            <<: *failCommand_failPoint
   115            data: { failCommands: [find], errorCode: 7 }
   116        operations: [*retryable_operation]
   117        expectations:
   118             - *retryable_command_started_event
   119             - *retryable_command_started_event
   120             - *find_chunks_command_started_event
   121    -
   122        description: "Download succeeds after HostUnreachable"
   123        failPoint:
   124            <<: *failCommand_failPoint
   125            data: { failCommands: [find], errorCode: 6 }
   126        operations: [*retryable_operation]
   127        expectations:
   128             - *retryable_command_started_event
   129             - *retryable_command_started_event
   130             - *find_chunks_command_started_event
   131    -
   132        description: "Download succeeds after NetworkTimeout"
   133        failPoint:
   134            <<: *failCommand_failPoint
   135            data: { failCommands: [find], errorCode: 89 }
   136        operations: [*retryable_operation]
   137        expectations:
   138             - *retryable_command_started_event
   139             - *retryable_command_started_event
   140             - *find_chunks_command_started_event
   141    -
   142        description: "Download succeeds after SocketException"
   143        failPoint:
   144            <<: *failCommand_failPoint
   145            data: { failCommands: [find], errorCode: 9001 }
   146        operations: [*retryable_operation]
   147        expectations:
   148             - *retryable_command_started_event
   149             - *retryable_command_started_event
   150             - *find_chunks_command_started_event
   151    -
   152        description: "Download fails after two NotWritablePrimary errors"
   153        failPoint:
   154            <<: *failCommand_failPoint
   155            mode: { times: 2 }
   156            data: { failCommands: [find], errorCode: 10107 }
   157        operations:
   158            - &retryable_operation_fails
   159                <<: *retryable_operation
   160                error: true
   161        expectations:
   162             - *retryable_command_started_event
   163             - *retryable_command_started_event
   164    -
   165        description: "Download fails after NotWritablePrimary when retryReads is false"
   166        clientOptions:
   167            retryReads: false
   168        failPoint:
   169            <<: *failCommand_failPoint
   170            data: { failCommands: [find], errorCode: 10107 }
   171        operations: [*retryable_operation_fails]
   172        expectations:
   173             - *retryable_command_started_event

View as plain text