...

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

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

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

View as plain text