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

PBM-1308: Improve read/write concern validation #946

Merged
merged 2 commits into from
May 15, 2024

Conversation

boris-ilijic
Copy link
Member

Fix for https://perconadev.atlassian.net/browse/PBM-1308 .

Following validation are added:

mongodb://pbmuser:[email protected]:30001/?authSource=admin&w=1
mongodb://pbmuser:[email protected]:30001/?authSource=admin&w=1&readConcernLevel=majority
-----
Exit: connect to PBM: create mongo connection: invalid connection string option: ReadConcern majority and WriteConcern 1 is not allowed
mongodb://pbmuser:[email protected]:30001/?authSource=admin&w=1&readConcernLevel=available
mongodb://pbmuser:[email protected]:30001/?authSource=admin&w=1&readConcernLevel=snapshot
mongodb://pbmuser:[email protected]:30001/?authSource=admin&w=1&readConcernLevel=linearizable
mongodb://pbmuser:[email protected]:30001/?authSource=admin&w=1&readConcernLevel=abc
-----
Exit: connect to PBM: create mongo connection: invalid connection string option: ReadConcern level is not allowed

In addition read/write concern info is added in pbm-agent startup log info:

mongodb://pbmuser:[email protected]:30001/?authSource=admin
-----
...
GoVersion: go1.22.1
2024-05-15T10:23:15.000+0200 I starting PITR routine
2024-05-15T10:23:15.000+0200 I node: rs0/rs01:30001
2024-05-15T10:23:15.000+0200 I conn level ReadConcern: majority; WriteConcern: majority
2024-05-15T10:23:15.000+0200 I listening for the commands
...
mongodb://pbmuser:[email protected]:30001/?authSource=admin&w=1&readConcernLevel=local
-----
...
GoVersion: go1.22.1
2024-05-15T10:21:36.000+0200 I starting PITR routine
2024-05-15T10:21:36.000+0200 I node: rs0/rs01:30001
2024-05-15T10:21:36.000+0200 I conn level ReadConcern: local; WriteConcern: 1
2024-05-15T10:21:36.000+0200 I listening for the commands
...

@boris-ilijic boris-ilijic merged commit 126e0e7 into dev May 15, 2024
27 checks passed
@boris-ilijic boris-ilijic deleted the PBM-1308-improve-read-write-concern-validation branch May 15, 2024 09:37
@defbin defbin added this to the 2.6.0 milestone Aug 9, 2024
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