Skip to content
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

Change read preference #113

Merged
merged 5 commits into from
Jun 7, 2024
Merged

Change read preference #113

merged 5 commits into from
Jun 7, 2024

Conversation

yuema137
Copy link
Contributor

@yuema137 yuema137 commented Jun 7, 2024

In the current rundb.py the read preference for the MongoDB client is set to be SecondaryPreffered. But it doesn't stop the client from reading from the primary when the secondaries are not available. As the network bandwidth of the primary one is not satisfactory, we should avoid reading from the primary and just read from the secondaries.

Reference: the documentation of pymongo about the read preference:
https://pymongo.readthedocs.io/en/stable/api/pymongo/read_preferences.html

@yuema137 yuema137 merged commit bdb0df0 into master Jun 7, 2024
1 check passed
@yuema137 yuema137 deleted the change_read_preference branch June 7, 2024 15:48
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