Skip to content

PYTHON-3021 Send primaryPreferred when connected to standalone servers #799

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 1 commit into from
Nov 19, 2021

Conversation

ShaneHarvey
Copy link
Member

No description provided.

server = self._select_server(read_preference, session)
single = topology.description.topology_type == TOPOLOGY_TYPE.Single
Copy link
Member Author

Choose a reason for hiding this comment

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

This fixes the bug. The problem is that before this _select_server call the topology_type could be Unknown in which case we would incorrectly set single to False.

Copy link
Contributor

Choose a reason for hiding this comment

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

That makes sense.

Copy link
Contributor

@juliusgeo juliusgeo left a comment

Choose a reason for hiding this comment

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

LGTM!

server = self._select_server(read_preference, session)
single = topology.description.topology_type == TOPOLOGY_TYPE.Single
Copy link
Contributor

Choose a reason for hiding this comment

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

That makes sense.

@ShaneHarvey ShaneHarvey merged commit 7965906 into mongodb:master Nov 19, 2021
@ShaneHarvey ShaneHarvey deleted the PYTHON-3021 branch November 19, 2021 00:28
juliusgeo pushed a commit to juliusgeo/mongo-python-driver that referenced this pull request Apr 5, 2022
juliusgeo pushed a commit to juliusgeo/mongo-python-driver that referenced this pull request Apr 7, 2022
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