...

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

View as plain text