...

Text file src/go.mongodb.org/mongo-driver/testdata/retryable-reads/listDatabases-serverErrors.json

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

     1{
     2  "runOn": [
     3    {
     4      "minServerVersion": "4.0",
     5      "topology": [
     6        "single",
     7        "replicaset"
     8      ]
     9    },
    10    {
    11      "minServerVersion": "4.1.7",
    12      "topology": [
    13        "sharded",
    14        "load-balanced"
    15      ]
    16    }
    17  ],
    18  "database_name": "retryable-reads-tests",
    19  "collection_name": "coll",
    20  "data": [],
    21  "tests": [
    22    {
    23      "description": "ListDatabases succeeds after InterruptedAtShutdown",
    24      "failPoint": {
    25        "configureFailPoint": "failCommand",
    26        "mode": {
    27          "times": 1
    28        },
    29        "data": {
    30          "failCommands": [
    31            "listDatabases"
    32          ],
    33          "errorCode": 11600
    34        }
    35      },
    36      "operations": [
    37        {
    38          "name": "listDatabases",
    39          "object": "client"
    40        }
    41      ],
    42      "expectations": [
    43        {
    44          "command_started_event": {
    45            "command": {
    46              "listDatabases": 1
    47            }
    48          }
    49        },
    50        {
    51          "command_started_event": {
    52            "command": {
    53              "listDatabases": 1
    54            }
    55          }
    56        }
    57      ]
    58    },
    59    {
    60      "description": "ListDatabases succeeds after InterruptedDueToReplStateChange",
    61      "failPoint": {
    62        "configureFailPoint": "failCommand",
    63        "mode": {
    64          "times": 1
    65        },
    66        "data": {
    67          "failCommands": [
    68            "listDatabases"
    69          ],
    70          "errorCode": 11602
    71        }
    72      },
    73      "operations": [
    74        {
    75          "name": "listDatabases",
    76          "object": "client"
    77        }
    78      ],
    79      "expectations": [
    80        {
    81          "command_started_event": {
    82            "command": {
    83              "listDatabases": 1
    84            }
    85          }
    86        },
    87        {
    88          "command_started_event": {
    89            "command": {
    90              "listDatabases": 1
    91            }
    92          }
    93        }
    94      ]
    95    },
    96    {
    97      "description": "ListDatabases succeeds after NotWritablePrimary",
    98      "failPoint": {
    99        "configureFailPoint": "failCommand",
   100        "mode": {
   101          "times": 1
   102        },
   103        "data": {
   104          "failCommands": [
   105            "listDatabases"
   106          ],
   107          "errorCode": 10107
   108        }
   109      },
   110      "operations": [
   111        {
   112          "name": "listDatabases",
   113          "object": "client"
   114        }
   115      ],
   116      "expectations": [
   117        {
   118          "command_started_event": {
   119            "command": {
   120              "listDatabases": 1
   121            }
   122          }
   123        },
   124        {
   125          "command_started_event": {
   126            "command": {
   127              "listDatabases": 1
   128            }
   129          }
   130        }
   131      ]
   132    },
   133    {
   134      "description": "ListDatabases succeeds after NotPrimaryNoSecondaryOk",
   135      "failPoint": {
   136        "configureFailPoint": "failCommand",
   137        "mode": {
   138          "times": 1
   139        },
   140        "data": {
   141          "failCommands": [
   142            "listDatabases"
   143          ],
   144          "errorCode": 13435
   145        }
   146      },
   147      "operations": [
   148        {
   149          "name": "listDatabases",
   150          "object": "client"
   151        }
   152      ],
   153      "expectations": [
   154        {
   155          "command_started_event": {
   156            "command": {
   157              "listDatabases": 1
   158            }
   159          }
   160        },
   161        {
   162          "command_started_event": {
   163            "command": {
   164              "listDatabases": 1
   165            }
   166          }
   167        }
   168      ]
   169    },
   170    {
   171      "description": "ListDatabases succeeds after NotPrimaryOrSecondary",
   172      "failPoint": {
   173        "configureFailPoint": "failCommand",
   174        "mode": {
   175          "times": 1
   176        },
   177        "data": {
   178          "failCommands": [
   179            "listDatabases"
   180          ],
   181          "errorCode": 13436
   182        }
   183      },
   184      "operations": [
   185        {
   186          "name": "listDatabases",
   187          "object": "client"
   188        }
   189      ],
   190      "expectations": [
   191        {
   192          "command_started_event": {
   193            "command": {
   194              "listDatabases": 1
   195            }
   196          }
   197        },
   198        {
   199          "command_started_event": {
   200            "command": {
   201              "listDatabases": 1
   202            }
   203          }
   204        }
   205      ]
   206    },
   207    {
   208      "description": "ListDatabases succeeds after PrimarySteppedDown",
   209      "failPoint": {
   210        "configureFailPoint": "failCommand",
   211        "mode": {
   212          "times": 1
   213        },
   214        "data": {
   215          "failCommands": [
   216            "listDatabases"
   217          ],
   218          "errorCode": 189
   219        }
   220      },
   221      "operations": [
   222        {
   223          "name": "listDatabases",
   224          "object": "client"
   225        }
   226      ],
   227      "expectations": [
   228        {
   229          "command_started_event": {
   230            "command": {
   231              "listDatabases": 1
   232            }
   233          }
   234        },
   235        {
   236          "command_started_event": {
   237            "command": {
   238              "listDatabases": 1
   239            }
   240          }
   241        }
   242      ]
   243    },
   244    {
   245      "description": "ListDatabases succeeds after ShutdownInProgress",
   246      "failPoint": {
   247        "configureFailPoint": "failCommand",
   248        "mode": {
   249          "times": 1
   250        },
   251        "data": {
   252          "failCommands": [
   253            "listDatabases"
   254          ],
   255          "errorCode": 91
   256        }
   257      },
   258      "operations": [
   259        {
   260          "name": "listDatabases",
   261          "object": "client"
   262        }
   263      ],
   264      "expectations": [
   265        {
   266          "command_started_event": {
   267            "command": {
   268              "listDatabases": 1
   269            }
   270          }
   271        },
   272        {
   273          "command_started_event": {
   274            "command": {
   275              "listDatabases": 1
   276            }
   277          }
   278        }
   279      ]
   280    },
   281    {
   282      "description": "ListDatabases succeeds after HostNotFound",
   283      "failPoint": {
   284        "configureFailPoint": "failCommand",
   285        "mode": {
   286          "times": 1
   287        },
   288        "data": {
   289          "failCommands": [
   290            "listDatabases"
   291          ],
   292          "errorCode": 7
   293        }
   294      },
   295      "operations": [
   296        {
   297          "name": "listDatabases",
   298          "object": "client"
   299        }
   300      ],
   301      "expectations": [
   302        {
   303          "command_started_event": {
   304            "command": {
   305              "listDatabases": 1
   306            }
   307          }
   308        },
   309        {
   310          "command_started_event": {
   311            "command": {
   312              "listDatabases": 1
   313            }
   314          }
   315        }
   316      ]
   317    },
   318    {
   319      "description": "ListDatabases succeeds after HostUnreachable",
   320      "failPoint": {
   321        "configureFailPoint": "failCommand",
   322        "mode": {
   323          "times": 1
   324        },
   325        "data": {
   326          "failCommands": [
   327            "listDatabases"
   328          ],
   329          "errorCode": 6
   330        }
   331      },
   332      "operations": [
   333        {
   334          "name": "listDatabases",
   335          "object": "client"
   336        }
   337      ],
   338      "expectations": [
   339        {
   340          "command_started_event": {
   341            "command": {
   342              "listDatabases": 1
   343            }
   344          }
   345        },
   346        {
   347          "command_started_event": {
   348            "command": {
   349              "listDatabases": 1
   350            }
   351          }
   352        }
   353      ]
   354    },
   355    {
   356      "description": "ListDatabases succeeds after NetworkTimeout",
   357      "failPoint": {
   358        "configureFailPoint": "failCommand",
   359        "mode": {
   360          "times": 1
   361        },
   362        "data": {
   363          "failCommands": [
   364            "listDatabases"
   365          ],
   366          "errorCode": 89
   367        }
   368      },
   369      "operations": [
   370        {
   371          "name": "listDatabases",
   372          "object": "client"
   373        }
   374      ],
   375      "expectations": [
   376        {
   377          "command_started_event": {
   378            "command": {
   379              "listDatabases": 1
   380            }
   381          }
   382        },
   383        {
   384          "command_started_event": {
   385            "command": {
   386              "listDatabases": 1
   387            }
   388          }
   389        }
   390      ]
   391    },
   392    {
   393      "description": "ListDatabases succeeds after SocketException",
   394      "failPoint": {
   395        "configureFailPoint": "failCommand",
   396        "mode": {
   397          "times": 1
   398        },
   399        "data": {
   400          "failCommands": [
   401            "listDatabases"
   402          ],
   403          "errorCode": 9001
   404        }
   405      },
   406      "operations": [
   407        {
   408          "name": "listDatabases",
   409          "object": "client"
   410        }
   411      ],
   412      "expectations": [
   413        {
   414          "command_started_event": {
   415            "command": {
   416              "listDatabases": 1
   417            }
   418          }
   419        },
   420        {
   421          "command_started_event": {
   422            "command": {
   423              "listDatabases": 1
   424            }
   425          }
   426        }
   427      ]
   428    },
   429    {
   430      "description": "ListDatabases fails after two NotWritablePrimary errors",
   431      "failPoint": {
   432        "configureFailPoint": "failCommand",
   433        "mode": {
   434          "times": 2
   435        },
   436        "data": {
   437          "failCommands": [
   438            "listDatabases"
   439          ],
   440          "errorCode": 10107
   441        }
   442      },
   443      "operations": [
   444        {
   445          "name": "listDatabases",
   446          "object": "client",
   447          "error": true
   448        }
   449      ],
   450      "expectations": [
   451        {
   452          "command_started_event": {
   453            "command": {
   454              "listDatabases": 1
   455            }
   456          }
   457        },
   458        {
   459          "command_started_event": {
   460            "command": {
   461              "listDatabases": 1
   462            }
   463          }
   464        }
   465      ]
   466    },
   467    {
   468      "description": "ListDatabases fails after NotWritablePrimary when retryReads is false",
   469      "clientOptions": {
   470        "retryReads": false
   471      },
   472      "failPoint": {
   473        "configureFailPoint": "failCommand",
   474        "mode": {
   475          "times": 1
   476        },
   477        "data": {
   478          "failCommands": [
   479            "listDatabases"
   480          ],
   481          "errorCode": 10107
   482        }
   483      },
   484      "operations": [
   485        {
   486          "name": "listDatabases",
   487          "object": "client",
   488          "error": true
   489        }
   490      ],
   491      "expectations": [
   492        {
   493          "command_started_event": {
   494            "command": {
   495              "listDatabases": 1
   496            }
   497          }
   498        }
   499      ]
   500    }
   501  ]
   502}

View as plain text