The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
# Primary has wire version 5, secondary has 4, read preference primaryPreferred
# with maxStalenessSeconds. The client must error, even though it uses primary and
# never applies maxStalenessSeconds. Proves that the compatibility check precedes
# filtration.
---
topology_description:
  type: ReplicaSetWithPrimary
  servers:
  - &1
    address: a:27017
    type: RSPrimary
    avg_rtt_ms: 5
    lastUpdateTime: 0
    maxWireVersion: 5
    lastWrite: {lastWriteDate: {$numberLong: "1"}}
  - &2
    address: b:27017
    type: RSSecondary
    avg_rtt_ms: 5
    lastUpdateTime: 0
    maxWireVersion: 4  # Too old.
    lastWrite: {lastWriteDate: {$numberLong: "1"}}
read_preference:
  mode: PrimaryPreferred
  maxStalenessSeconds: 150
error: true