...

Text file src/go.mongodb.org/mongo-driver/testdata/max-staleness/ReplicaSetNoPrimary/LastUpdateTime.yml

Documentation: go.mongodb.org/mongo-driver/testdata/max-staleness/ReplicaSetNoPrimary

     1heartbeatFrequencyMS: 25000  # 25 seconds.
     2topology_description:
     3  type: ReplicaSetNoPrimary
     4  servers:
     5  - &1
     6    address: a:27017
     7    type: RSSecondary
     8    avg_rtt_ms: 5
     9    lastUpdateTime: 1
    10    lastWrite: {lastWriteDate: {$numberLong: "125002"}}
    11    maxWireVersion: 6
    12  - &2
    13    address: b:27017
    14    type: RSSecondary
    15    avg_rtt_ms: 50  # Too far.
    16    lastUpdateTime: 25002  # Not used when there's no primary.
    17    lastWrite: {lastWriteDate: {$numberLong: "2"}}  # 125 sec stale + 25 sec heartbeat <= 150 sec maxStaleness.
    18    maxWireVersion: 6
    19  - &3
    20    address: c:27017
    21    type: RSSecondary
    22    avg_rtt_ms: 5
    23    lastUpdateTime: 25001
    24    lastWrite: {lastWriteDate: {$numberLong: "1"}}  # Too stale.
    25    maxWireVersion: 6
    26read_preference:
    27  mode: Nearest
    28  maxStalenessSeconds: 150
    29suitable_servers:
    30- *1
    31- *2
    32in_latency_window:
    33- *1

View as plain text