-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
MDEV-35511: Backport fix for Audit log not reporting user in Galera cluster #4412
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
Conversation
|
|
janlindstrom
left a comment
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.
LGTM.
sql/sql_show.cc
Outdated
| /* USER */ | ||
| val= tmp_sctx->user && tmp_sctx->user != slave_user ? tmp_sctx->user : | ||
| val= tmp_sctx->user && (tmp_sctx->user != slave_user && | ||
| tmp_sctx->user != cluster_user) ? tmp_sctx->user : |
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.
Nick-pit: Formatting is incorrect.
38d35d7 to
2e04278
Compare
…luster Setting a nae for the the THD::security_ctx:user field for wsrep applier threads. With this, the audit log events related to wsrep applying will be written in the audit log. Using user name <cluster user> for wsrep appliers. This is for having identical look with async replication, which uses: <replication_user> user name. Another option for <cluster user> could be e.g. <wsrep user>. Hoever, using galera for user name is not a good pick, as the cluster may have (and soon will have) other GCS backends. Using same approach as async replication to replace the security_ctx user name with "system user" for processlist output. Commit has also mtr test galera.MDEV-35511, to vevrify wsrep applier audit logging. The test does not install/uninstall audit log plugin, bu loads the audit log plugin before the test. This is because uninstalling the audit log plugin gives a warning saying that plugin is busy and uninstall will be delayed until server shutdown. This anomaly must be because of the applier thread being active audit logger. Same problem with plugin unsinstall happens also with async relication workers. If plugn remains installed, the post test sanity check will complain of mismatching state of pre and post test states.
2e04278 to
41a2ccc
Compare
| const char *my_localhost= "localhost", | ||
| *delayed_user= "delayed", *slave_user= "<replication_slave>"; | ||
| *delayed_user= "delayed", *slave_user= "<replication_slave>", | ||
| *cluster_user= "<cluster applier>"; |
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.
isn't it supposed to be "wsrep applier" ?
|
moved to another PR for 10.11 |
Description
This PR assigns a user name "" for wsrep applier threads. With this change, audit log plugin will recognize applier threads and print events for their activities in the audit log.
Release Notes
audit log will have events for galera cluster replication applier operations with generic name
How can this PR be tested?
PR has a new mtr test: galera.MDEV-35511
TODO: modify the automated test suite to verify that the PR causes MariaDB to behave as intended.
Consult the documentation on "Writing good test cases".
If the changes are not amenable to automated testing, please explain why not and carefully describe how to test manually.
Basing the PR against the correct MariaDB version
mainbranch.PR quality check