puppetlabs-mysql
puppetlabs-mysql copied to clipboard
Fix backup/rotation with multiple excluded databases
Summary
Right now, excluding multiple databases does not work. This MR aims to fix excluding multiple databases, by revising the respective regular expression.
Additional Context
- When using multiple excluded databases, the list of databases is filtered using
grep -v. i.e.grep -v '^\(information_schema|performance_schema\)$ - When using Basic vs Extended Regular Expressions, the characters
(and|lose their special meaning, the backslashed versions have to be used. For the group (()) the escaping has been done, however the alternation is unescaped.
Leading to:
- All the excluded databases will be backed up.
- In case a database is not backuppable (which is why it had been excluded), this leads to the cleanup not being run at all, as it depends on the backup having been successful.
Checklist
- [x] 🟢 Spec tests.
- [x] 🟢 Acceptance tests.
- [x] Manually verified.
Branch is working in production without problems.
Should I rebase this branch on top of the current main?
I was wondering why no tests catched the issue you described. Turns out there's a test, but only for ancient mysql: https://github.com/puppetlabs/puppetlabs-mysql/pull/1642.
Should I try and port the test forward before merging @bastelfreak ?
@bastelfreak I rebased the branch on top of current main, hopefully the tests go through.