...

Text file src/go.mongodb.org/mongo-driver/testdata/server-discovery-and-monitoring/errors/stale-topologyVersion-NotPrimaryOrSecondary.yml

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

     1# Autogenerated tests for SDAM error handling, see generate-error-tests.py
     2description: Stale topologyVersion NotPrimaryOrSecondary error
     3uri: mongodb://a/?replicaSet=rs
     4phases:
     5- description: Primary A is discovered
     6  responses:
     7  - - a:27017
     8    - ok: 1
     9      helloOk: true
    10      isWritablePrimary: true
    11      hosts:
    12      - a:27017
    13      setName: rs
    14      minWireVersion: 0
    15      maxWireVersion: 9
    16      topologyVersion: &topologyVersion_1_1
    17        processId:
    18          "$oid": '000000000000000000000001'
    19        counter:
    20          "$numberLong": '1'
    21  outcome: &outcome
    22    servers:
    23      a:27017:
    24        type: RSPrimary
    25        setName: rs
    26        topologyVersion: *topologyVersion_1_1
    27        pool:
    28          generation: 0
    29    topologyType: ReplicaSetWithPrimary
    30    logicalSessionTimeoutMinutes: null
    31    setName: rs
    32
    33- description: Ignore stale NotPrimaryOrSecondary error (topologyVersion less)
    34  applicationErrors:
    35  - address: a:27017
    36    when: afterHandshakeCompletes
    37    maxWireVersion: 9
    38    type: command
    39    response:
    40      ok: 0
    41      errmsg: NotPrimaryOrSecondary
    42      code: 13436
    43      topologyVersion:
    44        processId:
    45          "$oid": '000000000000000000000001'
    46        counter:
    47          "$numberLong": '0'
    48  outcome: *outcome
    49
    50- description: Ignore stale NotPrimaryOrSecondary error (topologyVersion equal)
    51  applicationErrors:
    52  - address: a:27017
    53    when: afterHandshakeCompletes
    54    maxWireVersion: 9
    55    type: command
    56    response:
    57      ok: 0
    58      errmsg: NotPrimaryOrSecondary
    59      code: 13436
    60      topologyVersion:
    61        processId:
    62          "$oid": '000000000000000000000001'
    63        counter:
    64          "$numberLong": '1'
    65  outcome: *outcome

View as plain text