...

Text file src/go.mongodb.org/mongo-driver/testdata/retryable-writes/legacy/updateOne-serverErrors.json

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

     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    }
    16  ],
    17  "data": [
    18    {
    19      "_id": 1,
    20      "x": 11
    21    },
    22    {
    23      "_id": 2,
    24      "x": 22
    25    }
    26  ],
    27  "tests": [
    28    {
    29      "description": "UpdateOne succeeds after PrimarySteppedDown",
    30      "failPoint": {
    31        "configureFailPoint": "failCommand",
    32        "mode": {
    33          "times": 1
    34        },
    35        "data": {
    36          "failCommands": [
    37            "update"
    38          ],
    39          "errorCode": 189,
    40          "errorLabels": [
    41            "RetryableWriteError"
    42          ]
    43        }
    44      },
    45      "operation": {
    46        "name": "updateOne",
    47        "arguments": {
    48          "filter": {
    49            "_id": 1
    50          },
    51          "update": {
    52            "$inc": {
    53              "x": 1
    54            }
    55          }
    56        }
    57      },
    58      "outcome": {
    59        "result": {
    60          "matchedCount": 1,
    61          "modifiedCount": 1,
    62          "upsertedCount": 0
    63        },
    64        "collection": {
    65          "data": [
    66            {
    67              "_id": 1,
    68              "x": 12
    69            },
    70            {
    71              "_id": 2,
    72              "x": 22
    73            }
    74          ]
    75        }
    76      }
    77    },
    78    {
    79      "description": "UpdateOne succeeds after WriteConcernError ShutdownInProgress",
    80      "failPoint": {
    81        "configureFailPoint": "failCommand",
    82        "mode": {
    83          "times": 1
    84        },
    85        "data": {
    86          "failCommands": [
    87            "update"
    88          ],
    89          "writeConcernError": {
    90            "code": 91,
    91            "errmsg": "Replication is being shut down",
    92            "errorLabels": [
    93              "RetryableWriteError"
    94            ]
    95          }
    96        }
    97      },
    98      "operation": {
    99        "name": "updateOne",
   100        "arguments": {
   101          "filter": {
   102            "_id": 1
   103          },
   104          "update": {
   105            "$inc": {
   106              "x": 1
   107            }
   108          }
   109        }
   110      },
   111      "outcome": {
   112        "result": {
   113          "matchedCount": 1,
   114          "modifiedCount": 1,
   115          "upsertedCount": 0
   116        },
   117        "collection": {
   118          "data": [
   119            {
   120              "_id": 1,
   121              "x": 12
   122            },
   123            {
   124              "_id": 2,
   125              "x": 22
   126            }
   127          ]
   128        }
   129      }
   130    },
   131    {
   132      "description": "UpdateOne fails with a RetryableWriteError label after two connection failures",
   133      "failPoint": {
   134        "configureFailPoint": "failCommand",
   135        "mode": {
   136          "times": 2
   137        },
   138        "data": {
   139          "failCommands": [
   140            "update"
   141          ],
   142          "closeConnection": true
   143        }
   144      },
   145      "operation": {
   146        "name": "updateOne",
   147        "arguments": {
   148          "filter": {
   149            "_id": 1
   150          },
   151          "update": {
   152            "$inc": {
   153              "x": 1
   154            }
   155          }
   156        }
   157      },
   158      "outcome": {
   159        "error": true,
   160        "result": {
   161          "errorLabelsContain": [
   162            "RetryableWriteError"
   163          ]
   164        },
   165        "collection": {
   166          "data": [
   167            {
   168              "_id": 1,
   169              "x": 11
   170            },
   171            {
   172              "_id": 2,
   173              "x": 22
   174            }
   175          ]
   176        }
   177      }
   178    }
   179  ]
   180}

View as plain text