...

Text file src/go.mongodb.org/mongo-driver/testdata/server-discovery-and-monitoring/rs/primary_disconnect_setversion.json

Documentation: go.mongodb.org/mongo-driver/testdata/server-discovery-and-monitoring/rs

     1{
     2  "description": "Disconnected from primary, reject primary with stale setVersion",
     3  "uri": "mongodb://a/?replicaSet=rs",
     4  "phases": [
     5    {
     6      "responses": [
     7        [
     8          "a:27017",
     9          {
    10            "ok": 1,
    11            "helloOk": true,
    12            "isWritablePrimary": true,
    13            "hosts": [
    14              "a:27017",
    15              "b:27017"
    16            ],
    17            "setName": "rs",
    18            "setVersion": 1,
    19            "electionId": {
    20              "$oid": "000000000000000000000001"
    21            },
    22            "minWireVersion": 0,
    23            "maxWireVersion": 6
    24          }
    25        ],
    26        [
    27          "b:27017",
    28          {
    29            "ok": 1,
    30            "helloOk": true,
    31            "isWritablePrimary": true,
    32            "hosts": [
    33              "a:27017",
    34              "b:27017"
    35            ],
    36            "setName": "rs",
    37            "setVersion": 2,
    38            "electionId": {
    39              "$oid": "000000000000000000000001"
    40            },
    41            "minWireVersion": 0,
    42            "maxWireVersion": 6
    43          }
    44        ]
    45      ],
    46      "outcome": {
    47        "servers": {
    48          "a:27017": {
    49            "type": "Unknown",
    50            "setName": null,
    51            "electionId": null
    52          },
    53          "b:27017": {
    54            "type": "RSPrimary",
    55            "setName": "rs",
    56            "setVersion": 2,
    57            "electionId": {
    58              "$oid": "000000000000000000000001"
    59            }
    60          }
    61        },
    62        "topologyType": "ReplicaSetWithPrimary",
    63        "logicalSessionTimeoutMinutes": null,
    64        "setName": "rs",
    65        "maxSetVersion": 2,
    66        "maxElectionId": {
    67          "$oid": "000000000000000000000001"
    68        }
    69      }
    70    },
    71    {
    72      "responses": [
    73        [
    74          "b:27017",
    75          {}
    76        ]
    77      ],
    78      "outcome": {
    79        "servers": {
    80          "a:27017": {
    81            "type": "Unknown",
    82            "setName": null,
    83            "electionId": null
    84          },
    85          "b:27017": {
    86            "type": "Unknown",
    87            "setName": null,
    88            "electionId": null
    89          }
    90        },
    91        "topologyType": "ReplicaSetNoPrimary",
    92        "logicalSessionTimeoutMinutes": null,
    93        "setName": "rs",
    94        "maxSetVersion": 2,
    95        "maxElectionId": {
    96          "$oid": "000000000000000000000001"
    97        }
    98      }
    99    },
   100    {
   101      "responses": [
   102        [
   103          "a:27017",
   104          {
   105            "ok": 1,
   106            "helloOk": true,
   107            "isWritablePrimary": true,
   108            "hosts": [
   109              "a:27017",
   110              "b:27017"
   111            ],
   112            "setName": "rs",
   113            "setVersion": 1,
   114            "electionId": {
   115              "$oid": "000000000000000000000001"
   116            },
   117            "minWireVersion": 0,
   118            "maxWireVersion": 6
   119          }
   120        ]
   121      ],
   122      "outcome": {
   123        "servers": {
   124          "a:27017": {
   125            "type": "Unknown",
   126            "setName": null,
   127            "electionId": null
   128          },
   129          "b:27017": {
   130            "type": "Unknown",
   131            "setName": null,
   132            "electionId": null
   133          }
   134        },
   135        "topologyType": "ReplicaSetNoPrimary",
   136        "logicalSessionTimeoutMinutes": null,
   137        "setName": "rs",
   138        "maxSetVersion": 2,
   139        "maxElectionId": {
   140          "$oid": "000000000000000000000001"
   141        }
   142      }
   143    },
   144    {
   145      "responses": [
   146        [
   147          "a:27017",
   148          {
   149            "ok": 1,
   150            "helloOk": true,
   151            "isWritablePrimary": true,
   152            "hosts": [
   153              "a:27017",
   154              "b:27017"
   155            ],
   156            "setName": "rs",
   157            "setVersion": 2,
   158            "electionId": {
   159              "$oid": "000000000000000000000002"
   160            },
   161            "minWireVersion": 0,
   162            "maxWireVersion": 6
   163          }
   164        ]
   165      ],
   166      "outcome": {
   167        "servers": {
   168          "a:27017": {
   169            "type": "RSPrimary",
   170            "setName": "rs",
   171            "setVersion": 2,
   172            "electionId": {
   173              "$oid": "000000000000000000000002"
   174            }
   175          },
   176          "b:27017": {
   177            "type": "Unknown",
   178            "setName": null,
   179            "electionId": null
   180          }
   181        },
   182        "topologyType": "ReplicaSetWithPrimary",
   183        "logicalSessionTimeoutMinutes": null,
   184        "setName": "rs",
   185        "maxSetVersion": 2,
   186        "maxElectionId": {
   187          "$oid": "000000000000000000000002"
   188        }
   189      }
   190    },
   191    {
   192      "responses": [
   193        [
   194          "b:27017",
   195          {
   196            "ok": 1,
   197            "helloOk": true,
   198            "isWritablePrimary": false,
   199            "secondary": true,
   200            "hosts": [
   201              "a:27017",
   202              "b:27017"
   203            ],
   204            "setName": "rs",
   205            "minWireVersion": 0,
   206            "maxWireVersion": 6
   207          }
   208        ]
   209      ],
   210      "outcome": {
   211        "servers": {
   212          "a:27017": {
   213            "type": "RSPrimary",
   214            "setName": "rs",
   215            "setVersion": 2,
   216            "electionId": {
   217              "$oid": "000000000000000000000002"
   218            }
   219          },
   220          "b:27017": {
   221            "type": "RSSecondary",
   222            "setName": "rs"
   223          }
   224        },
   225        "topologyType": "ReplicaSetWithPrimary",
   226        "logicalSessionTimeoutMinutes": null,
   227        "setName": "rs",
   228        "maxSetVersion": 2,
   229        "maxElectionId": {
   230          "$oid": "000000000000000000000002"
   231        }
   232      }
   233    }
   234  ]
   235}

View as plain text