Skip to content

PYTHON-4960 More informative error message for stale primary #2115

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Mar 5, 2025

Conversation

ShaneHarvey
Copy link
Member

@ShaneHarvey ShaneHarvey commented Jan 31, 2025

PYTHON-4960 More informative error message for stale primary

Implementation of mongodb/specifications#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>]>

@ShaneHarvey
Copy link
Member Author

Depends on #2093

@ShaneHarvey ShaneHarvey marked this pull request as ready for review March 4, 2025 23:43
@ShaneHarvey ShaneHarvey requested a review from sleepyStick March 4, 2025 23:43
@ShaneHarvey ShaneHarvey merged commit de09181 into mongodb:master Mar 5, 2025
35 of 38 checks passed
@ShaneHarvey ShaneHarvey deleted the PYTHON-4960 branch March 5, 2025 21:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants