...

Text file src/go.mongodb.org/mongo-driver/testdata/retryable-reads/findOne-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    {
    22      "_id": 1,
    23      "x": 11
    24    },
    25    {
    26      "_id": 2,
    27      "x": 22
    28    },
    29    {
    30      "_id": 3,
    31      "x": 33
    32    },
    33    {
    34      "_id": 4,
    35      "x": 44
    36    },
    37    {
    38      "_id": 5,
    39      "x": 55
    40    }
    41  ],
    42  "tests": [
    43    {
    44      "description": "FindOne succeeds after InterruptedAtShutdown",
    45      "failPoint": {
    46        "configureFailPoint": "failCommand",
    47        "mode": {
    48          "times": 1
    49        },
    50        "data": {
    51          "failCommands": [
    52            "find"
    53          ],
    54          "errorCode": 11600
    55        }
    56      },
    57      "operations": [
    58        {
    59          "name": "findOne",
    60          "object": "collection",
    61          "arguments": {
    62            "filter": {
    63              "_id": 1
    64            }
    65          },
    66          "result": {
    67            "_id": 1,
    68            "x": 11
    69          }
    70        }
    71      ],
    72      "expectations": [
    73        {
    74          "command_started_event": {
    75            "command": {
    76              "find": "coll",
    77              "filter": {
    78                "_id": 1
    79              }
    80            },
    81            "database_name": "retryable-reads-tests"
    82          }
    83        },
    84        {
    85          "command_started_event": {
    86            "command": {
    87              "find": "coll",
    88              "filter": {
    89                "_id": 1
    90              }
    91            },
    92            "database_name": "retryable-reads-tests"
    93          }
    94        }
    95      ]
    96    },
    97    {
    98      "description": "FindOne succeeds after InterruptedDueToReplStateChange",
    99      "failPoint": {
   100        "configureFailPoint": "failCommand",
   101        "mode": {
   102          "times": 1
   103        },
   104        "data": {
   105          "failCommands": [
   106            "find"
   107          ],
   108          "errorCode": 11602
   109        }
   110      },
   111      "operations": [
   112        {
   113          "name": "findOne",
   114          "object": "collection",
   115          "arguments": {
   116            "filter": {
   117              "_id": 1
   118            }
   119          },
   120          "result": {
   121            "_id": 1,
   122            "x": 11
   123          }
   124        }
   125      ],
   126      "expectations": [
   127        {
   128          "command_started_event": {
   129            "command": {
   130              "find": "coll",
   131              "filter": {
   132                "_id": 1
   133              }
   134            },
   135            "database_name": "retryable-reads-tests"
   136          }
   137        },
   138        {
   139          "command_started_event": {
   140            "command": {
   141              "find": "coll",
   142              "filter": {
   143                "_id": 1
   144              }
   145            },
   146            "database_name": "retryable-reads-tests"
   147          }
   148        }
   149      ]
   150    },
   151    {
   152      "description": "FindOne succeeds after NotWritablePrimary",
   153      "failPoint": {
   154        "configureFailPoint": "failCommand",
   155        "mode": {
   156          "times": 1
   157        },
   158        "data": {
   159          "failCommands": [
   160            "find"
   161          ],
   162          "errorCode": 10107
   163        }
   164      },
   165      "operations": [
   166        {
   167          "name": "findOne",
   168          "object": "collection",
   169          "arguments": {
   170            "filter": {
   171              "_id": 1
   172            }
   173          },
   174          "result": {
   175            "_id": 1,
   176            "x": 11
   177          }
   178        }
   179      ],
   180      "expectations": [
   181        {
   182          "command_started_event": {
   183            "command": {
   184              "find": "coll",
   185              "filter": {
   186                "_id": 1
   187              }
   188            },
   189            "database_name": "retryable-reads-tests"
   190          }
   191        },
   192        {
   193          "command_started_event": {
   194            "command": {
   195              "find": "coll",
   196              "filter": {
   197                "_id": 1
   198              }
   199            },
   200            "database_name": "retryable-reads-tests"
   201          }
   202        }
   203      ]
   204    },
   205    {
   206      "description": "FindOne succeeds after NotPrimaryNoSecondaryOk",
   207      "failPoint": {
   208        "configureFailPoint": "failCommand",
   209        "mode": {
   210          "times": 1
   211        },
   212        "data": {
   213          "failCommands": [
   214            "find"
   215          ],
   216          "errorCode": 13435
   217        }
   218      },
   219      "operations": [
   220        {
   221          "name": "findOne",
   222          "object": "collection",
   223          "arguments": {
   224            "filter": {
   225              "_id": 1
   226            }
   227          },
   228          "result": {
   229            "_id": 1,
   230            "x": 11
   231          }
   232        }
   233      ],
   234      "expectations": [
   235        {
   236          "command_started_event": {
   237            "command": {
   238              "find": "coll",
   239              "filter": {
   240                "_id": 1
   241              }
   242            },
   243            "database_name": "retryable-reads-tests"
   244          }
   245        },
   246        {
   247          "command_started_event": {
   248            "command": {
   249              "find": "coll",
   250              "filter": {
   251                "_id": 1
   252              }
   253            },
   254            "database_name": "retryable-reads-tests"
   255          }
   256        }
   257      ]
   258    },
   259    {
   260      "description": "FindOne succeeds after NotPrimaryOrSecondary",
   261      "failPoint": {
   262        "configureFailPoint": "failCommand",
   263        "mode": {
   264          "times": 1
   265        },
   266        "data": {
   267          "failCommands": [
   268            "find"
   269          ],
   270          "errorCode": 13436
   271        }
   272      },
   273      "operations": [
   274        {
   275          "name": "findOne",
   276          "object": "collection",
   277          "arguments": {
   278            "filter": {
   279              "_id": 1
   280            }
   281          },
   282          "result": {
   283            "_id": 1,
   284            "x": 11
   285          }
   286        }
   287      ],
   288      "expectations": [
   289        {
   290          "command_started_event": {
   291            "command": {
   292              "find": "coll",
   293              "filter": {
   294                "_id": 1
   295              }
   296            },
   297            "database_name": "retryable-reads-tests"
   298          }
   299        },
   300        {
   301          "command_started_event": {
   302            "command": {
   303              "find": "coll",
   304              "filter": {
   305                "_id": 1
   306              }
   307            },
   308            "database_name": "retryable-reads-tests"
   309          }
   310        }
   311      ]
   312    },
   313    {
   314      "description": "FindOne succeeds after PrimarySteppedDown",
   315      "failPoint": {
   316        "configureFailPoint": "failCommand",
   317        "mode": {
   318          "times": 1
   319        },
   320        "data": {
   321          "failCommands": [
   322            "find"
   323          ],
   324          "errorCode": 189
   325        }
   326      },
   327      "operations": [
   328        {
   329          "name": "findOne",
   330          "object": "collection",
   331          "arguments": {
   332            "filter": {
   333              "_id": 1
   334            }
   335          },
   336          "result": {
   337            "_id": 1,
   338            "x": 11
   339          }
   340        }
   341      ],
   342      "expectations": [
   343        {
   344          "command_started_event": {
   345            "command": {
   346              "find": "coll",
   347              "filter": {
   348                "_id": 1
   349              }
   350            },
   351            "database_name": "retryable-reads-tests"
   352          }
   353        },
   354        {
   355          "command_started_event": {
   356            "command": {
   357              "find": "coll",
   358              "filter": {
   359                "_id": 1
   360              }
   361            },
   362            "database_name": "retryable-reads-tests"
   363          }
   364        }
   365      ]
   366    },
   367    {
   368      "description": "FindOne succeeds after ShutdownInProgress",
   369      "failPoint": {
   370        "configureFailPoint": "failCommand",
   371        "mode": {
   372          "times": 1
   373        },
   374        "data": {
   375          "failCommands": [
   376            "find"
   377          ],
   378          "errorCode": 91
   379        }
   380      },
   381      "operations": [
   382        {
   383          "name": "findOne",
   384          "object": "collection",
   385          "arguments": {
   386            "filter": {
   387              "_id": 1
   388            }
   389          },
   390          "result": {
   391            "_id": 1,
   392            "x": 11
   393          }
   394        }
   395      ],
   396      "expectations": [
   397        {
   398          "command_started_event": {
   399            "command": {
   400              "find": "coll",
   401              "filter": {
   402                "_id": 1
   403              }
   404            },
   405            "database_name": "retryable-reads-tests"
   406          }
   407        },
   408        {
   409          "command_started_event": {
   410            "command": {
   411              "find": "coll",
   412              "filter": {
   413                "_id": 1
   414              }
   415            },
   416            "database_name": "retryable-reads-tests"
   417          }
   418        }
   419      ]
   420    },
   421    {
   422      "description": "FindOne succeeds after HostNotFound",
   423      "failPoint": {
   424        "configureFailPoint": "failCommand",
   425        "mode": {
   426          "times": 1
   427        },
   428        "data": {
   429          "failCommands": [
   430            "find"
   431          ],
   432          "errorCode": 7
   433        }
   434      },
   435      "operations": [
   436        {
   437          "name": "findOne",
   438          "object": "collection",
   439          "arguments": {
   440            "filter": {
   441              "_id": 1
   442            }
   443          },
   444          "result": {
   445            "_id": 1,
   446            "x": 11
   447          }
   448        }
   449      ],
   450      "expectations": [
   451        {
   452          "command_started_event": {
   453            "command": {
   454              "find": "coll",
   455              "filter": {
   456                "_id": 1
   457              }
   458            },
   459            "database_name": "retryable-reads-tests"
   460          }
   461        },
   462        {
   463          "command_started_event": {
   464            "command": {
   465              "find": "coll",
   466              "filter": {
   467                "_id": 1
   468              }
   469            },
   470            "database_name": "retryable-reads-tests"
   471          }
   472        }
   473      ]
   474    },
   475    {
   476      "description": "FindOne succeeds after HostUnreachable",
   477      "failPoint": {
   478        "configureFailPoint": "failCommand",
   479        "mode": {
   480          "times": 1
   481        },
   482        "data": {
   483          "failCommands": [
   484            "find"
   485          ],
   486          "errorCode": 6
   487        }
   488      },
   489      "operations": [
   490        {
   491          "name": "findOne",
   492          "object": "collection",
   493          "arguments": {
   494            "filter": {
   495              "_id": 1
   496            }
   497          },
   498          "result": {
   499            "_id": 1,
   500            "x": 11
   501          }
   502        }
   503      ],
   504      "expectations": [
   505        {
   506          "command_started_event": {
   507            "command": {
   508              "find": "coll",
   509              "filter": {
   510                "_id": 1
   511              }
   512            },
   513            "database_name": "retryable-reads-tests"
   514          }
   515        },
   516        {
   517          "command_started_event": {
   518            "command": {
   519              "find": "coll",
   520              "filter": {
   521                "_id": 1
   522              }
   523            },
   524            "database_name": "retryable-reads-tests"
   525          }
   526        }
   527      ]
   528    },
   529    {
   530      "description": "FindOne succeeds after NetworkTimeout",
   531      "failPoint": {
   532        "configureFailPoint": "failCommand",
   533        "mode": {
   534          "times": 1
   535        },
   536        "data": {
   537          "failCommands": [
   538            "find"
   539          ],
   540          "errorCode": 89
   541        }
   542      },
   543      "operations": [
   544        {
   545          "name": "findOne",
   546          "object": "collection",
   547          "arguments": {
   548            "filter": {
   549              "_id": 1
   550            }
   551          },
   552          "result": {
   553            "_id": 1,
   554            "x": 11
   555          }
   556        }
   557      ],
   558      "expectations": [
   559        {
   560          "command_started_event": {
   561            "command": {
   562              "find": "coll",
   563              "filter": {
   564                "_id": 1
   565              }
   566            },
   567            "database_name": "retryable-reads-tests"
   568          }
   569        },
   570        {
   571          "command_started_event": {
   572            "command": {
   573              "find": "coll",
   574              "filter": {
   575                "_id": 1
   576              }
   577            },
   578            "database_name": "retryable-reads-tests"
   579          }
   580        }
   581      ]
   582    },
   583    {
   584      "description": "FindOne succeeds after SocketException",
   585      "failPoint": {
   586        "configureFailPoint": "failCommand",
   587        "mode": {
   588          "times": 1
   589        },
   590        "data": {
   591          "failCommands": [
   592            "find"
   593          ],
   594          "errorCode": 9001
   595        }
   596      },
   597      "operations": [
   598        {
   599          "name": "findOne",
   600          "object": "collection",
   601          "arguments": {
   602            "filter": {
   603              "_id": 1
   604            }
   605          },
   606          "result": {
   607            "_id": 1,
   608            "x": 11
   609          }
   610        }
   611      ],
   612      "expectations": [
   613        {
   614          "command_started_event": {
   615            "command": {
   616              "find": "coll",
   617              "filter": {
   618                "_id": 1
   619              }
   620            },
   621            "database_name": "retryable-reads-tests"
   622          }
   623        },
   624        {
   625          "command_started_event": {
   626            "command": {
   627              "find": "coll",
   628              "filter": {
   629                "_id": 1
   630              }
   631            },
   632            "database_name": "retryable-reads-tests"
   633          }
   634        }
   635      ]
   636    },
   637    {
   638      "description": "FindOne fails after two NotWritablePrimary errors",
   639      "failPoint": {
   640        "configureFailPoint": "failCommand",
   641        "mode": {
   642          "times": 2
   643        },
   644        "data": {
   645          "failCommands": [
   646            "find"
   647          ],
   648          "errorCode": 10107
   649        }
   650      },
   651      "operations": [
   652        {
   653          "name": "findOne",
   654          "object": "collection",
   655          "arguments": {
   656            "filter": {
   657              "_id": 1
   658            }
   659          },
   660          "error": true
   661        }
   662      ],
   663      "expectations": [
   664        {
   665          "command_started_event": {
   666            "command": {
   667              "find": "coll",
   668              "filter": {
   669                "_id": 1
   670              }
   671            },
   672            "database_name": "retryable-reads-tests"
   673          }
   674        },
   675        {
   676          "command_started_event": {
   677            "command": {
   678              "find": "coll",
   679              "filter": {
   680                "_id": 1
   681              }
   682            },
   683            "database_name": "retryable-reads-tests"
   684          }
   685        }
   686      ]
   687    },
   688    {
   689      "description": "FindOne fails after NotWritablePrimary when retryReads is false",
   690      "clientOptions": {
   691        "retryReads": false
   692      },
   693      "failPoint": {
   694        "configureFailPoint": "failCommand",
   695        "mode": {
   696          "times": 1
   697        },
   698        "data": {
   699          "failCommands": [
   700            "find"
   701          ],
   702          "errorCode": 10107
   703        }
   704      },
   705      "operations": [
   706        {
   707          "name": "findOne",
   708          "object": "collection",
   709          "arguments": {
   710            "filter": {
   711              "_id": 1
   712            }
   713          },
   714          "error": true
   715        }
   716      ],
   717      "expectations": [
   718        {
   719          "command_started_event": {
   720            "command": {
   721              "find": "coll",
   722              "filter": {
   723                "_id": 1
   724              }
   725            },
   726            "database_name": "retryable-reads-tests"
   727          }
   728        }
   729      ]
   730    }
   731  ]
   732}

View as plain text