...

Text file src/go.mongodb.org/mongo-driver/testdata/max-staleness/ReplicaSetWithPrimary/SecondaryPreferred.yml

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

     1# Fallback to primary if no secondary is fresh enough.
     2---
     3topology_description:
     4  type: ReplicaSetWithPrimary
     5  servers:
     6  - &1
     7    address: a:27017
     8    type: RSPrimary
     9    avg_rtt_ms: 5
    10    lastUpdateTime: 0
    11    maxWireVersion: 6
    12    lastWrite: {lastWriteDate: {$numberLong: "1000001"}}
    13  - &2
    14    address: b:27017
    15    type: RSSecondary
    16    avg_rtt_ms: 5
    17    lastUpdateTime: 0
    18    maxWireVersion: 6
    19    lastWrite: {lastWriteDate: {$numberLong: "1"}}  # Very stale.
    20read_preference:
    21  mode: SecondaryPreferred
    22  maxStalenessSeconds: 120
    23suitable_servers:
    24- *1
    25in_latency_window:
    26- *1

View as plain text