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

Use rs.secondaryOk on versions that deprecated rs.slaveOk #594

Merged
merged 1 commit into from
Oct 6, 2020

Conversation

svenbs
Copy link
Contributor

@svenbs svenbs commented Sep 30, 2020

Pull Request (PR) description

rs.slaveOk has been deprecated since version 3.6.20 and others. Warnings are all over the place e.g.
in the mongodb_is_master fact. Which makes the fact and /root/.mongrc.js unusable.

Using a try-catch block to use the new command rs.secondaryOK() by default and fall back to rs.slaveOK() fixes this.

@ekohl
Copy link
Member

ekohl commented Sep 30, 2020

This looks like a cleaner implementation than #593 since it gracefully falls back. At first glance it looks ok, but I'll wait for the tests to complete

rs.slaveOk has been deprecated and warnings are all over the place e.g.
in the mongodb_is_master fact.
Which makes the fact and /root/.mongrc.js unusable.

Use rs.secondaryOK by default and fall back gracefully on versions which
only support rs.slaveOk yet.
@svenbs
Copy link
Contributor Author

svenbs commented Oct 6, 2020

@ekohl : I've merged my changes into a single commit and also rebased on upstream/master.
Tests are running again. Please consider merging.

Copy link
Member

@ekohl ekohl left a comment

Choose a reason for hiding this comment

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

Thanks!

@ekohl ekohl changed the title fix: Use rs.secondaryOk on versions that deprecated rs.slaveOk Use rs.secondaryOk on versions that deprecated rs.slaveOk Oct 6, 2020
@ekohl ekohl merged commit 8890326 into voxpupuli:master Oct 6, 2020
@ekohl ekohl added the enhancement New feature or request label Oct 6, 2020
@svenbs svenbs deleted the fix-mongodb-slaveok branch October 28, 2020 07:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MongoDB 4.2.10 starts to emit warnings about slaveOk() being deprecated, which breaks the module
3 participants