...

Text file src/go.mongodb.org/mongo-driver/testdata/retryable-reads/countDocuments-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  "tests": [
    31    {
    32      "description": "CountDocuments succeeds after InterruptedAtShutdown",
    33      "failPoint": {
    34        "configureFailPoint": "failCommand",
    35        "mode": {
    36          "times": 1
    37        },
    38        "data": {
    39          "failCommands": [
    40            "aggregate"
    41          ],
    42          "errorCode": 11600
    43        }
    44      },
    45      "operations": [
    46        {
    47          "name": "countDocuments",
    48          "object": "collection",
    49          "arguments": {
    50            "filter": {}
    51          },
    52          "result": 2
    53        }
    54      ],
    55      "expectations": [
    56        {
    57          "command_started_event": {
    58            "command": {
    59              "aggregate": "coll",
    60              "pipeline": [
    61                {
    62                  "$match": {}
    63                },
    64                {
    65                  "$group": {
    66                    "_id": 1,
    67                    "n": {
    68                      "$sum": 1
    69                    }
    70                  }
    71                }
    72              ]
    73            },
    74            "database_name": "retryable-reads-tests"
    75          }
    76        },
    77        {
    78          "command_started_event": {
    79            "command": {
    80              "aggregate": "coll",
    81              "pipeline": [
    82                {
    83                  "$match": {}
    84                },
    85                {
    86                  "$group": {
    87                    "_id": 1,
    88                    "n": {
    89                      "$sum": 1
    90                    }
    91                  }
    92                }
    93              ]
    94            },
    95            "database_name": "retryable-reads-tests"
    96          }
    97        }
    98      ]
    99    },
   100    {
   101      "description": "CountDocuments succeeds after InterruptedDueToReplStateChange",
   102      "failPoint": {
   103        "configureFailPoint": "failCommand",
   104        "mode": {
   105          "times": 1
   106        },
   107        "data": {
   108          "failCommands": [
   109            "aggregate"
   110          ],
   111          "errorCode": 11602
   112        }
   113      },
   114      "operations": [
   115        {
   116          "name": "countDocuments",
   117          "object": "collection",
   118          "arguments": {
   119            "filter": {}
   120          },
   121          "result": 2
   122        }
   123      ],
   124      "expectations": [
   125        {
   126          "command_started_event": {
   127            "command": {
   128              "aggregate": "coll",
   129              "pipeline": [
   130                {
   131                  "$match": {}
   132                },
   133                {
   134                  "$group": {
   135                    "_id": 1,
   136                    "n": {
   137                      "$sum": 1
   138                    }
   139                  }
   140                }
   141              ]
   142            },
   143            "database_name": "retryable-reads-tests"
   144          }
   145        },
   146        {
   147          "command_started_event": {
   148            "command": {
   149              "aggregate": "coll",
   150              "pipeline": [
   151                {
   152                  "$match": {}
   153                },
   154                {
   155                  "$group": {
   156                    "_id": 1,
   157                    "n": {
   158                      "$sum": 1
   159                    }
   160                  }
   161                }
   162              ]
   163            },
   164            "database_name": "retryable-reads-tests"
   165          }
   166        }
   167      ]
   168    },
   169    {
   170      "description": "CountDocuments succeeds after NotWritablePrimary",
   171      "failPoint": {
   172        "configureFailPoint": "failCommand",
   173        "mode": {
   174          "times": 1
   175        },
   176        "data": {
   177          "failCommands": [
   178            "aggregate"
   179          ],
   180          "errorCode": 10107
   181        }
   182      },
   183      "operations": [
   184        {
   185          "name": "countDocuments",
   186          "object": "collection",
   187          "arguments": {
   188            "filter": {}
   189          },
   190          "result": 2
   191        }
   192      ],
   193      "expectations": [
   194        {
   195          "command_started_event": {
   196            "command": {
   197              "aggregate": "coll",
   198              "pipeline": [
   199                {
   200                  "$match": {}
   201                },
   202                {
   203                  "$group": {
   204                    "_id": 1,
   205                    "n": {
   206                      "$sum": 1
   207                    }
   208                  }
   209                }
   210              ]
   211            },
   212            "database_name": "retryable-reads-tests"
   213          }
   214        },
   215        {
   216          "command_started_event": {
   217            "command": {
   218              "aggregate": "coll",
   219              "pipeline": [
   220                {
   221                  "$match": {}
   222                },
   223                {
   224                  "$group": {
   225                    "_id": 1,
   226                    "n": {
   227                      "$sum": 1
   228                    }
   229                  }
   230                }
   231              ]
   232            },
   233            "database_name": "retryable-reads-tests"
   234          }
   235        }
   236      ]
   237    },
   238    {
   239      "description": "CountDocuments succeeds after NotPrimaryNoSecondaryOk",
   240      "failPoint": {
   241        "configureFailPoint": "failCommand",
   242        "mode": {
   243          "times": 1
   244        },
   245        "data": {
   246          "failCommands": [
   247            "aggregate"
   248          ],
   249          "errorCode": 13435
   250        }
   251      },
   252      "operations": [
   253        {
   254          "name": "countDocuments",
   255          "object": "collection",
   256          "arguments": {
   257            "filter": {}
   258          },
   259          "result": 2
   260        }
   261      ],
   262      "expectations": [
   263        {
   264          "command_started_event": {
   265            "command": {
   266              "aggregate": "coll",
   267              "pipeline": [
   268                {
   269                  "$match": {}
   270                },
   271                {
   272                  "$group": {
   273                    "_id": 1,
   274                    "n": {
   275                      "$sum": 1
   276                    }
   277                  }
   278                }
   279              ]
   280            },
   281            "database_name": "retryable-reads-tests"
   282          }
   283        },
   284        {
   285          "command_started_event": {
   286            "command": {
   287              "aggregate": "coll",
   288              "pipeline": [
   289                {
   290                  "$match": {}
   291                },
   292                {
   293                  "$group": {
   294                    "_id": 1,
   295                    "n": {
   296                      "$sum": 1
   297                    }
   298                  }
   299                }
   300              ]
   301            },
   302            "database_name": "retryable-reads-tests"
   303          }
   304        }
   305      ]
   306    },
   307    {
   308      "description": "CountDocuments succeeds after NotPrimaryOrSecondary",
   309      "failPoint": {
   310        "configureFailPoint": "failCommand",
   311        "mode": {
   312          "times": 1
   313        },
   314        "data": {
   315          "failCommands": [
   316            "aggregate"
   317          ],
   318          "errorCode": 13436
   319        }
   320      },
   321      "operations": [
   322        {
   323          "name": "countDocuments",
   324          "object": "collection",
   325          "arguments": {
   326            "filter": {}
   327          },
   328          "result": 2
   329        }
   330      ],
   331      "expectations": [
   332        {
   333          "command_started_event": {
   334            "command": {
   335              "aggregate": "coll",
   336              "pipeline": [
   337                {
   338                  "$match": {}
   339                },
   340                {
   341                  "$group": {
   342                    "_id": 1,
   343                    "n": {
   344                      "$sum": 1
   345                    }
   346                  }
   347                }
   348              ]
   349            },
   350            "database_name": "retryable-reads-tests"
   351          }
   352        },
   353        {
   354          "command_started_event": {
   355            "command": {
   356              "aggregate": "coll",
   357              "pipeline": [
   358                {
   359                  "$match": {}
   360                },
   361                {
   362                  "$group": {
   363                    "_id": 1,
   364                    "n": {
   365                      "$sum": 1
   366                    }
   367                  }
   368                }
   369              ]
   370            },
   371            "database_name": "retryable-reads-tests"
   372          }
   373        }
   374      ]
   375    },
   376    {
   377      "description": "CountDocuments succeeds after PrimarySteppedDown",
   378      "failPoint": {
   379        "configureFailPoint": "failCommand",
   380        "mode": {
   381          "times": 1
   382        },
   383        "data": {
   384          "failCommands": [
   385            "aggregate"
   386          ],
   387          "errorCode": 189
   388        }
   389      },
   390      "operations": [
   391        {
   392          "name": "countDocuments",
   393          "object": "collection",
   394          "arguments": {
   395            "filter": {}
   396          },
   397          "result": 2
   398        }
   399      ],
   400      "expectations": [
   401        {
   402          "command_started_event": {
   403            "command": {
   404              "aggregate": "coll",
   405              "pipeline": [
   406                {
   407                  "$match": {}
   408                },
   409                {
   410                  "$group": {
   411                    "_id": 1,
   412                    "n": {
   413                      "$sum": 1
   414                    }
   415                  }
   416                }
   417              ]
   418            },
   419            "database_name": "retryable-reads-tests"
   420          }
   421        },
   422        {
   423          "command_started_event": {
   424            "command": {
   425              "aggregate": "coll",
   426              "pipeline": [
   427                {
   428                  "$match": {}
   429                },
   430                {
   431                  "$group": {
   432                    "_id": 1,
   433                    "n": {
   434                      "$sum": 1
   435                    }
   436                  }
   437                }
   438              ]
   439            },
   440            "database_name": "retryable-reads-tests"
   441          }
   442        }
   443      ]
   444    },
   445    {
   446      "description": "CountDocuments succeeds after ShutdownInProgress",
   447      "failPoint": {
   448        "configureFailPoint": "failCommand",
   449        "mode": {
   450          "times": 1
   451        },
   452        "data": {
   453          "failCommands": [
   454            "aggregate"
   455          ],
   456          "errorCode": 91
   457        }
   458      },
   459      "operations": [
   460        {
   461          "name": "countDocuments",
   462          "object": "collection",
   463          "arguments": {
   464            "filter": {}
   465          },
   466          "result": 2
   467        }
   468      ],
   469      "expectations": [
   470        {
   471          "command_started_event": {
   472            "command": {
   473              "aggregate": "coll",
   474              "pipeline": [
   475                {
   476                  "$match": {}
   477                },
   478                {
   479                  "$group": {
   480                    "_id": 1,
   481                    "n": {
   482                      "$sum": 1
   483                    }
   484                  }
   485                }
   486              ]
   487            },
   488            "database_name": "retryable-reads-tests"
   489          }
   490        },
   491        {
   492          "command_started_event": {
   493            "command": {
   494              "aggregate": "coll",
   495              "pipeline": [
   496                {
   497                  "$match": {}
   498                },
   499                {
   500                  "$group": {
   501                    "_id": 1,
   502                    "n": {
   503                      "$sum": 1
   504                    }
   505                  }
   506                }
   507              ]
   508            },
   509            "database_name": "retryable-reads-tests"
   510          }
   511        }
   512      ]
   513    },
   514    {
   515      "description": "CountDocuments succeeds after HostNotFound",
   516      "failPoint": {
   517        "configureFailPoint": "failCommand",
   518        "mode": {
   519          "times": 1
   520        },
   521        "data": {
   522          "failCommands": [
   523            "aggregate"
   524          ],
   525          "errorCode": 7
   526        }
   527      },
   528      "operations": [
   529        {
   530          "name": "countDocuments",
   531          "object": "collection",
   532          "arguments": {
   533            "filter": {}
   534          },
   535          "result": 2
   536        }
   537      ],
   538      "expectations": [
   539        {
   540          "command_started_event": {
   541            "command": {
   542              "aggregate": "coll",
   543              "pipeline": [
   544                {
   545                  "$match": {}
   546                },
   547                {
   548                  "$group": {
   549                    "_id": 1,
   550                    "n": {
   551                      "$sum": 1
   552                    }
   553                  }
   554                }
   555              ]
   556            },
   557            "database_name": "retryable-reads-tests"
   558          }
   559        },
   560        {
   561          "command_started_event": {
   562            "command": {
   563              "aggregate": "coll",
   564              "pipeline": [
   565                {
   566                  "$match": {}
   567                },
   568                {
   569                  "$group": {
   570                    "_id": 1,
   571                    "n": {
   572                      "$sum": 1
   573                    }
   574                  }
   575                }
   576              ]
   577            },
   578            "database_name": "retryable-reads-tests"
   579          }
   580        }
   581      ]
   582    },
   583    {
   584      "description": "CountDocuments succeeds after HostUnreachable",
   585      "failPoint": {
   586        "configureFailPoint": "failCommand",
   587        "mode": {
   588          "times": 1
   589        },
   590        "data": {
   591          "failCommands": [
   592            "aggregate"
   593          ],
   594          "errorCode": 6
   595        }
   596      },
   597      "operations": [
   598        {
   599          "name": "countDocuments",
   600          "object": "collection",
   601          "arguments": {
   602            "filter": {}
   603          },
   604          "result": 2
   605        }
   606      ],
   607      "expectations": [
   608        {
   609          "command_started_event": {
   610            "command": {
   611              "aggregate": "coll",
   612              "pipeline": [
   613                {
   614                  "$match": {}
   615                },
   616                {
   617                  "$group": {
   618                    "_id": 1,
   619                    "n": {
   620                      "$sum": 1
   621                    }
   622                  }
   623                }
   624              ]
   625            },
   626            "database_name": "retryable-reads-tests"
   627          }
   628        },
   629        {
   630          "command_started_event": {
   631            "command": {
   632              "aggregate": "coll",
   633              "pipeline": [
   634                {
   635                  "$match": {}
   636                },
   637                {
   638                  "$group": {
   639                    "_id": 1,
   640                    "n": {
   641                      "$sum": 1
   642                    }
   643                  }
   644                }
   645              ]
   646            },
   647            "database_name": "retryable-reads-tests"
   648          }
   649        }
   650      ]
   651    },
   652    {
   653      "description": "CountDocuments succeeds after NetworkTimeout",
   654      "failPoint": {
   655        "configureFailPoint": "failCommand",
   656        "mode": {
   657          "times": 1
   658        },
   659        "data": {
   660          "failCommands": [
   661            "aggregate"
   662          ],
   663          "errorCode": 89
   664        }
   665      },
   666      "operations": [
   667        {
   668          "name": "countDocuments",
   669          "object": "collection",
   670          "arguments": {
   671            "filter": {}
   672          },
   673          "result": 2
   674        }
   675      ],
   676      "expectations": [
   677        {
   678          "command_started_event": {
   679            "command": {
   680              "aggregate": "coll",
   681              "pipeline": [
   682                {
   683                  "$match": {}
   684                },
   685                {
   686                  "$group": {
   687                    "_id": 1,
   688                    "n": {
   689                      "$sum": 1
   690                    }
   691                  }
   692                }
   693              ]
   694            },
   695            "database_name": "retryable-reads-tests"
   696          }
   697        },
   698        {
   699          "command_started_event": {
   700            "command": {
   701              "aggregate": "coll",
   702              "pipeline": [
   703                {
   704                  "$match": {}
   705                },
   706                {
   707                  "$group": {
   708                    "_id": 1,
   709                    "n": {
   710                      "$sum": 1
   711                    }
   712                  }
   713                }
   714              ]
   715            },
   716            "database_name": "retryable-reads-tests"
   717          }
   718        }
   719      ]
   720    },
   721    {
   722      "description": "CountDocuments succeeds after SocketException",
   723      "failPoint": {
   724        "configureFailPoint": "failCommand",
   725        "mode": {
   726          "times": 1
   727        },
   728        "data": {
   729          "failCommands": [
   730            "aggregate"
   731          ],
   732          "errorCode": 9001
   733        }
   734      },
   735      "operations": [
   736        {
   737          "name": "countDocuments",
   738          "object": "collection",
   739          "arguments": {
   740            "filter": {}
   741          },
   742          "result": 2
   743        }
   744      ],
   745      "expectations": [
   746        {
   747          "command_started_event": {
   748            "command": {
   749              "aggregate": "coll",
   750              "pipeline": [
   751                {
   752                  "$match": {}
   753                },
   754                {
   755                  "$group": {
   756                    "_id": 1,
   757                    "n": {
   758                      "$sum": 1
   759                    }
   760                  }
   761                }
   762              ]
   763            },
   764            "database_name": "retryable-reads-tests"
   765          }
   766        },
   767        {
   768          "command_started_event": {
   769            "command": {
   770              "aggregate": "coll",
   771              "pipeline": [
   772                {
   773                  "$match": {}
   774                },
   775                {
   776                  "$group": {
   777                    "_id": 1,
   778                    "n": {
   779                      "$sum": 1
   780                    }
   781                  }
   782                }
   783              ]
   784            },
   785            "database_name": "retryable-reads-tests"
   786          }
   787        }
   788      ]
   789    },
   790    {
   791      "description": "CountDocuments fails after two NotWritablePrimary errors",
   792      "failPoint": {
   793        "configureFailPoint": "failCommand",
   794        "mode": {
   795          "times": 2
   796        },
   797        "data": {
   798          "failCommands": [
   799            "aggregate"
   800          ],
   801          "errorCode": 10107
   802        }
   803      },
   804      "operations": [
   805        {
   806          "name": "countDocuments",
   807          "object": "collection",
   808          "arguments": {
   809            "filter": {}
   810          },
   811          "error": true
   812        }
   813      ],
   814      "expectations": [
   815        {
   816          "command_started_event": {
   817            "command": {
   818              "aggregate": "coll",
   819              "pipeline": [
   820                {
   821                  "$match": {}
   822                },
   823                {
   824                  "$group": {
   825                    "_id": 1,
   826                    "n": {
   827                      "$sum": 1
   828                    }
   829                  }
   830                }
   831              ]
   832            },
   833            "database_name": "retryable-reads-tests"
   834          }
   835        },
   836        {
   837          "command_started_event": {
   838            "command": {
   839              "aggregate": "coll",
   840              "pipeline": [
   841                {
   842                  "$match": {}
   843                },
   844                {
   845                  "$group": {
   846                    "_id": 1,
   847                    "n": {
   848                      "$sum": 1
   849                    }
   850                  }
   851                }
   852              ]
   853            },
   854            "database_name": "retryable-reads-tests"
   855          }
   856        }
   857      ]
   858    },
   859    {
   860      "description": "CountDocuments fails after NotWritablePrimary when retryReads is false",
   861      "clientOptions": {
   862        "retryReads": false
   863      },
   864      "failPoint": {
   865        "configureFailPoint": "failCommand",
   866        "mode": {
   867          "times": 1
   868        },
   869        "data": {
   870          "failCommands": [
   871            "aggregate"
   872          ],
   873          "errorCode": 10107
   874        }
   875      },
   876      "operations": [
   877        {
   878          "name": "countDocuments",
   879          "object": "collection",
   880          "arguments": {
   881            "filter": {}
   882          },
   883          "error": true
   884        }
   885      ],
   886      "expectations": [
   887        {
   888          "command_started_event": {
   889            "command": {
   890              "aggregate": "coll",
   891              "pipeline": [
   892                {
   893                  "$match": {}
   894                },
   895                {
   896                  "$group": {
   897                    "_id": 1,
   898                    "n": {
   899                      "$sum": 1
   900                    }
   901                  }
   902                }
   903              ]
   904            },
   905            "database_name": "retryable-reads-tests"
   906          }
   907        }
   908      ]
   909    }
   910  ]
   911}

View as plain text