Skip to content

MySQL 8.0: Grant required privileges to xtrabackup user #1478

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

Merged
merged 1 commit into from
Oct 24, 2022

Conversation

jan-win1993
Copy link
Contributor

@jan-win1993 jan-win1993 commented Jun 28, 2022

Since MySQL version 8.0 the backup user needs the following additional privileges:

  • SELECT privilege on the performance_schema.log_status table
  • SELECT privilege on the keyring_component_status table
  • BACKUP_ADMIN privilege on all tables *.*

https://docs.percona.com/percona-xtrabackup/latest/using_xtrabackup/privileges.html

@jan-win1993 jan-win1993 requested a review from a team as a code owner June 28, 2022 13:24
@puppet-community-rangefinder
Copy link

mysql::backup::xtrabackup is a class

that may have no external impact to Forge modules.

This module is declared in 140 of 579 indexed public Puppetfiles.


These results were generated with Rangefinder, a tool that helps predict the downstream impact of breaking changes to elements used in Puppet modules. You can run this on the command line to get a full report.

Exact matches are those that we can positively identify via namespace and the declaring modules' metadata. Non-namespaced items, such as Puppet 3.x functions, will always be reported as near matches only.

@CLAassistant
Copy link

CLAassistant commented Jun 28, 2022

CLA assistant check
All committers have signed the CLA.

@jan-win1993 jan-win1993 force-pushed the mysql-8-xtrabackup-privilege branch from 815a2a6 to b3ff102 Compare June 29, 2022 09:33
@jan-win1993 jan-win1993 force-pushed the mysql-8-xtrabackup-privilege branch 2 times, most recently from 1b1a11a to 6054c24 Compare July 11, 2022 15:41
@LukasAud
Copy link
Contributor

Hey @jan-win1993, this looks like a solid change 👍. However, some issues need to be addressed before it can be merged.

Firstly, it seems like our unit testing is not happy about some minor lint offences:
https://github.com/puppetlabs/puppetlabs-mysql/pull/1478/checks
Lint can be annoying sometimes with its rule enforcement but it's important to keep the code uniform across all changes.

And on the other hand, there seems to be two failures popping up across all OS:
https://github.com/puppetlabs/puppetlabs-mysql/runs/7290591003?check_suite_focus=true
The error messages suggest that there is some SQL syntax problems going on, although I could not pinpoint what the exact problem might be.

If you can take a look at those issues and make the appropriate changes to fix them, we will be happy to merge this PR.

P.D. Do not worry about the SLES-15 OS failure as that issue has been going for a while and its unrelated to your changes.

@jan-win1993 jan-win1993 force-pushed the mysql-8-xtrabackup-privilege branch from 6054c24 to 6f320fa Compare August 9, 2022 17:05
@jan-win1993
Copy link
Contributor Author

Hey @LukasAud ,
thanks for your suggestions.
The previous version of my if-condition did check if the custom fact "mysql_version" has a value above 8 , but this was also true for some MariaDB servers and the for example don't have a "BACKUP_ADMIN" privilege.
Weirdly this resulted in the Syntax Error log massage.
I've adjusted the if-condition to also check if it is a MariaDB or MySQL server, this did fix the issue on the few Litmus Docker Containers where I did run my tests locally. But there seems to be another issue going on, I will look into it in a few days.

@LukasAud
Copy link
Contributor

Happy to see some activity on this PR. Apart from the current issue, there also seem to be conflicts between the PR and main. This is probably due to some recent merged PRs/bugfixes. @jan-win1993 whenever you have a moment, can you make sure your branch is up-to-date? That should make the merge process faster 👍

@LukasAud
Copy link
Contributor

Hi @jan-win1993. It seems like this PR has been stale for a bit already. We are doing some clean-up around the modules to close unattended PRs. Please let us know if you are still interested in finishing this PR. Otherwise we will end up closing it soon.

Also, if you decide to continue working on this, be aware that you will most likely need to rebase and resolve conflicts. Best of luck!

@jan-win1993
Copy link
Contributor Author

jan-win1993 commented Oct 18, 2022

Hi @LukasAud sorry for the late reply, I've made a new merge request.

@jan-win1993 jan-win1993 force-pushed the mysql-8-xtrabackup-privilege branch from 6f320fa to 80af363 Compare October 20, 2022 16:06
@jan-win1993 jan-win1993 force-pushed the mysql-8-xtrabackup-privilege branch from 80af363 to f4e690b Compare October 21, 2022 15:23
@jan-win1993
Copy link
Contributor Author

Hi @LukasAud. My new solution did not work with Puppet Agent 6, because the Facter::Core::Execution.with_env ist function only available with Puppet Agent 7.
I hope my latest fix of the mysqld_version custom fact is not to hacky. This time I did run the unit & acceptance tests on all Litmus Docker containers with Puppet Agent 6 and Puppet Agent 7.

Copy link
Contributor

@LukasAud LukasAud left a comment

Choose a reason for hiding this comment

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

LGTM!

@LukasAud
Copy link
Contributor

Thanks for your contribution, @jan-win1993. Great job.

@LukasAud LukasAud merged commit 36383ed into puppetlabs:main Oct 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants