-
Notifications
You must be signed in to change notification settings - Fork 134
Allow to connect to Mongo without readConcern: majority #3459
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
base: main
Are you sure you want to change the base?
Allow to connect to Mongo without readConcern: majority #3459
Conversation
protos/peers.proto
Outdated
string tls_host = 6; | ||
optional string root_ca = 7 [(peerdb_redacted) = true]; | ||
ReadPreference read_preference = 8; | ||
optional SSHConfig ssh_config = 9; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, I should put the new one at the end.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
option should also be made so false will maintain existing behavior in order to be backwards compatible
@ST-eugenekrivdyuk Thanks for the PR. Understand the need to want to support a different readConcern. The config proposed makes readConcern == Majority a binary decision, which means it will be a bit trickier to extend if another readConcern level is preferred. Instead of using config, a simpler option I would recommend is passing in readConcern overrides via the URI as a param option, for example:
Then the only change you need to make in the code would be:
|
21a7e98
to
16768c8
Compare
@jgao54 Great idea! Makes everything a lot simpler 👍 I've updated the PR. |
Hmm, it's still not working on initial sync:
Even though in Mongo docs it says:
|
Dug into this a bit, the mongodb doc regarding to TL;DR: there are two separate things here:
Is not referring to this client-side According to Mongo docs:
Given your original error, seems like you are on a version older than 5.0, which had enableMajorityReadConcern set to
Which when I tested on my end, anything other than So i think in order for this connector to work for your PSA setup, this server-side config must be set to true. |
Just found the source code here that guards readConcern to majority . Could you test out if the connector works for you without the line My current understanding is that you would still hit the error |
@jgao54 I've tried it w/o setting
|
Thanks for the update @ST-eugenekrivdyuk. Seems like this is a MongoDB changestream limitation unfortunately. Will require enabling the server side config replication.enableMajorityReadconcern in order to be supported. |
Hello there!
I stumbled upon inability to mirror our MongoDB database due to the following error:
While I agree that it's a good default, it basically makes it impossible to work for certain MongoDB installations. In our case it's PSA (Primary, Secondayr, Arbiter) where setting read concern to majority is not always good.
Hence I propose to add an option to allow disabling majority read concern.
I am very new to the project - so it's likely that I've missed some things - apologies if that's the case 🙏