mongo-python-driver
mongo-python-driver copied to clipboard
PYTHON-4960 More informative error message for stale primary
PYTHON-4960 More informative error message for stale primary
Implementation of https://github.com/mongodb/specifications/pull/1729
Here's an example of the new TopologyDescriptions:
<TopologyDescription id: 67a69a832fcee4d4e6ab748f, topology_type: ReplicaSetWithPrimary, servers: [<ServerDescription ('a', 27017) server_type: Unknown, rtt: None, error=PyMongoError('primary marked stale due to discovery of newer primary')>, <ServerDescription ('b', 27017) server_type: RSPrimary, rtt: 0>]>
and
<TopologyDescription id: 67a69a832fcee4d4e6ab7491, topology_type: ReplicaSetWithPrimary, servers: [<ServerDescription ('a', 27017) server_type: Unknown, rtt: None, error=PyMongoError("primary marked stale due to electionId/setVersion mismatch, (ObjectId('000000000000000000000001'), 1) is stale compared to (ObjectId('000000000000000000000001'), 2)")>, <ServerDescription ('b', 27017) server_type: RSPrimary, rtt: 0>]>