...

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

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

     1description: Repeated isWritablePrimary response must be processed
     2
     3uri: "mongodb://a,b/?replicaSet=rs"
     4
     5phases:
     6  # Phase 1 - a says it's not primary and suggests c may be the primary
     7  - responses:
     8    -
     9      - "a:27017"
    10      - ok: 1
    11        helloOk: true
    12        isWritablePrimary: false
    13        secondary: true
    14        hidden: true
    15        hosts: ["a:27017", "c:27017"]
    16        setName: "rs"
    17        minWireVersion: 0
    18        maxWireVersion: 6
    19    outcome:
    20      servers:
    21        "a:27017":
    22          type: "RSOther"
    23          setName: "rs"
    24        
    25        "b:27017":
    26          type: Unknown
    27        
    28        "c:27017":
    29          type: Unknown
    30      topologyType: "ReplicaSetNoPrimary"
    31      logicalSessionTimeoutMinutes: ~
    32      setName: "rs"
    33
    34  # Phase 2 - c says it's a standalone, is removed
    35  - responses:
    36    -
    37      - "c:27017"
    38      - ok: 1
    39        helloOk: true
    40        isWritablePrimary: true
    41        minWireVersion: 0
    42        maxWireVersion: 6
    43    outcome:
    44      servers:
    45        "a:27017":
    46          type: "RSOther"
    47          setName: "rs"
    48        
    49        "b:27017":
    50          type: Unknown
    51      topologyType: "ReplicaSetNoPrimary"
    52      logicalSessionTimeoutMinutes: ~
    53      setName: "rs"
    54
    55  # Phase 3 - response from a is repeated, and must be processed; c added again
    56  - responses:
    57    -
    58      - "a:27017"
    59      - ok: 1
    60        helloOk: true
    61        isWritablePrimary: false
    62        secondary: true
    63        hidden: true
    64        hosts: ["a:27017", "c:27017"]
    65        setName: "rs"
    66        minWireVersion: 0
    67        maxWireVersion: 6
    68    outcome:
    69      servers:
    70        "a:27017":
    71          type: "RSOther"
    72          setName: "rs"
    73        
    74        "b:27017":
    75          type: Unknown
    76        
    77        "c:27017":
    78          type: Unknown
    79      topologyType: "ReplicaSetNoPrimary"
    80      logicalSessionTimeoutMinutes: ~
    81      setName: "rs"
    82
    83  # Phase 4 - c is now a primary
    84  - responses:
    85    -
    86      - "c:27017"
    87      - ok: 1
    88        helloOk: true
    89        isWritablePrimary: true
    90        hosts: ["a:27017", "c:27017"]
    91        setName: "rs"
    92        minWireVersion: 0
    93        maxWireVersion: 6
    94    outcome:
    95      servers:
    96        "a:27017":
    97          type: "RSOther"
    98          setName: "rs"
    99        
   100        "c:27017":
   101          type: RSPrimary
   102          setName: rs
   103      topologyType: "ReplicaSetWithPrimary"
   104      logicalSessionTimeoutMinutes: ~
   105      setName: "rs"

View as plain text