| 1 |
# Latest secondary's lastWriteDate is used normally with read preference tags. |
| 2 |
--- |
| 3 |
heartbeatFrequencyMS: 25000 # 25 seconds. |
| 4 |
topology_description: |
| 5 |
type: ReplicaSetNoPrimary |
| 6 |
servers: |
| 7 |
- &1 |
| 8 |
address: a:27017 |
| 9 |
type: RSSecondary |
| 10 |
avg_rtt_ms: 5 |
| 11 |
lastUpdateTime: 0 |
| 12 |
maxWireVersion: 6 |
| 13 |
lastWrite: {lastWriteDate: {$numberLong: "125002"}} |
| 14 |
tags: |
| 15 |
data_center: tokyo # No match, but its lastWriteDate is used in estimate. |
| 16 |
- &2 |
| 17 |
address: b:27017 |
| 18 |
type: RSSecondary |
| 19 |
avg_rtt_ms: 5 |
| 20 |
lastUpdateTime: 0 |
| 21 |
maxWireVersion: 6 |
| 22 |
lastWrite: {lastWriteDate: {$numberLong: "2"}} # 125 sec stale + 25 sec heartbeat <= 150 sec maxStaleness. |
| 23 |
tags: |
| 24 |
data_center: nyc |
| 25 |
- &3 |
| 26 |
address: c:27017 |
| 27 |
type: RSSecondary |
| 28 |
avg_rtt_ms: 5 |
| 29 |
lastUpdateTime: 0 |
| 30 |
maxWireVersion: 6 |
| 31 |
lastWrite: {lastWriteDate: {$numberLong: "1"}} # Too stale. |
| 32 |
tags: |
| 33 |
data_center: nyc |
| 34 |
- &4 |
| 35 |
address: d:27017 |
| 36 |
type: RSSecondary |
| 37 |
avg_rtt_ms: 5 |
| 38 |
lastUpdateTime: 0 |
| 39 |
maxWireVersion: 6 |
| 40 |
lastWrite: {lastWriteDate: {$numberLong: "2"}} |
| 41 |
tags: |
| 42 |
data_center: tokyo # No match. |
| 43 |
read_preference: |
| 44 |
mode: Secondary |
| 45 |
maxStalenessSeconds: 150 |
| 46 |
tag_sets: |
| 47 |
- data_center: nyc |
| 48 |
suitable_servers: |
| 49 |
- *2 |
| 50 |
in_latency_window: |
| 51 |
- *2 |