puppetlabs-mysql icon indicating copy to clipboard operation
puppetlabs-mysql copied to clipboard

Fix backup/rotation with multiple excluded databases

Open BuJo opened this issue 1 year ago • 3 comments
trafficstars

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.

BuJo avatar Dec 11 '23 10:12 BuJo

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Dec 11 '23 10:12 CLAassistant

Branch is working in production without problems.

BuJo avatar Jan 04 '24 11:01 BuJo

Should I rebase this branch on top of the current main?

BuJo avatar Jun 12 '24 13:06 BuJo

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.

bastelfreak avatar Jul 24 '24 11:07 bastelfreak

Should I try and port the test forward before merging @bastelfreak ?

BuJo avatar Aug 20 '24 09:08 BuJo

@bastelfreak I rebased the branch on top of current main, hopefully the tests go through.

BuJo avatar Oct 01 '24 14:10 BuJo