Skip to content

Conversation

@NoahStapp
Copy link
Contributor

@NoahStapp NoahStapp commented Dec 8, 2025

Changes in this PR

Align PyMongo's server selection process with the updated algorithm in DRIVERS-3344. The summary of these changes are:

  • Enable server deprioritization on all topologies instead of only sharded.
  • Filter out deprioritized servers before applying read/write preferences.

Test Plan

Expanded the existing server selection unit tests to include deprioritization tests.

Checklist

Checklist for Author

  • Did you update the changelog (if necessary)?
  • Is there test coverage?
  • Is any followup work tracked in a JIRA ticket? If so, add link(s).

Checklist for Reviewer

  • Does the title of the PR reference a JIRA Ticket?
  • Do you fully understand the implementation? (Would you be comfortable explaining how this code works to someone else?)
  • Is all relevant documentation (README or docstring) updated?

blink1073
blink1073 previously approved these changes Dec 9, 2025
Copy link
Member

@blink1073 blink1073 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM assuming nothing changes in the spec PR

caseyclements
caseyclements previously approved these changes Dec 9, 2025
Copy link
Contributor

@caseyclements caseyclements left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM conditional on currently running resync patch.

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.

3 participants