[MDEV-29110] mariabackup has wrong or missing plugin-dir default? Created: 2022-07-15 Updated: 2023-11-13 Resolved: 2023-11-09 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Backup, mariabackup |
| Affects Version/s: | 10.5 |
| Fix Version/s: | 10.4.33, 10.5.24, 10.6.17, 10.11.7, 11.0.5, 11.1.4, 11.2.3, 11.3.2, 11.4.1 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Hartmut Holzgraefe | Assignee: | Alexander Barkov |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | None | ||
| Description |
|
Preparing a backup taken on a server with data-at-rest encryption enabled fails with mariabackup: Can't open shared library '/file_key_management.so' (errno: 2, cannot open shared object file: No such file or directory) The prepare only succeeds after explicitly adding --plugin-dir=/usr/lib/mysql/plugins, which should not be necessary as it is the default path anyway. Full log output:
|
| Comments |
| Comment by Hartmut Holzgraefe [ 2022-07-15 ] | ||||||||||||||||||||||||||||||||||||||
|
Plugin dir indeed defaults to NULL here, proposed diff (against 10.6 branch):
| ||||||||||||||||||||||||||||||||||||||
| Comment by Daniel Black [ 2022-07-18 ] | ||||||||||||||||||||||||||||||||||||||
|
Note we've got the same plugin_dir option being used for both server and client plugins which I don't think are guaranteed to be the same. Client side is in extra/mariabackup/backup_mysql.cc mysql_options(connection, MYSQL_PLUGIN_DIR, xb_plugin_dir);. I don't have a good solution to the predicament either. Suggestions welcome. | ||||||||||||||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2022-07-20 ] | ||||||||||||||||||||||||||||||||||||||
|
Mariabackup prepare is supposed to take plugin_dir from backup-my.cnf stored along with the backup in the target directory, and it usually does so. | ||||||||||||||||||||||||||||||||||||||
| Comment by Hartmut Holzgraefe [ 2022-07-20 ] | ||||||||||||||||||||||||||||||||||||||
|
Uh, is it actually a good idea to take this specific setting from backup-my.cnf? Prepare could happen on a different machine than the actual backup, and even though it is likely that both have the same install prefix it is not guaranteed ... | ||||||||||||||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2022-07-20 ] | ||||||||||||||||||||||||||||||||||||||
|
The same can be said about using a hard default, it's not guaranteed at all that mariabackup is of the same version as mariadb/mysql plugins installed system-wide, or that anything is even installed system-wide at all. I don't think there is a universal solution, somebody will always have to override the value, either via the command line (if it's possible, I vaguely remember some problems with it) or by editing the config file. | ||||||||||||||||||||||||||||||||||||||
| Comment by Hartmut Holzgraefe [ 2022-07-20 ] | ||||||||||||||||||||||||||||||||||||||
|
It's more likely that a compiled in default is matching the actual install path when running backup and prepare on different machines then to assume that the paths are the same on backup and prepare systems. Most likely both are the same as even when a user is preparing on a different machine than the one the backup was taken from is using same OS release, generalCPU type, etc. But if prepare is run on a system where the default plugin dir path differs (e.g. /usr/lib/mysql/plugin vs. /usr/lib64/mysql/plugin) it is more likely that the compiled in default is correct than that the path is the same as on the machine the backup step had been run on So compiled in default looks more safe to me than value from backup-my.cnf. It will break for setups that deliberately chose to install everything, including libraries, under non-standard paths, but then again such users should know what they've done and that they might need to configure paths themselves accordingly | ||||||||||||||||||||||||||||||||||||||
| Comment by Alexander Barkov [ 2022-11-14 ] | ||||||||||||||||||||||||||||||||||||||
|
Hello hholzgra. I can see two ways: 2. Try to identify the machine somehow and detect implicit plugin-dir differently:
Can you please comment? | ||||||||||||||||||||||||||||||||||||||
| Comment by Hartmut Holzgraefe [ 2022-12-02 ] | ||||||||||||||||||||||||||||||||||||||
|
When I created the patch I was not aware of the backup-my.cnf logic, and how this makes things behave differently depending on whether --target-dir was given explicitly or not. I'm actually not sure whether backup-my.cnf or compile time plugin-dir, or target machine my.cnf setting if available, should take precedence ... | ||||||||||||||||||||||||||||||||||||||
| Comment by Hartmut Holzgraefe [ 2022-12-02 ] | ||||||||||||||||||||||||||||||||||||||
|
Maybe a different / additional approach: When loading a plugin, make sure plugin_dir is not empty or {/}, and produce a more meaningful error message than:
Something more like:
| ||||||||||||||||||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2023-05-17 ] | ||||||||||||||||||||||||||||||||||||||
|
As far as I understand, the first bug that the customer complained about was explained in this comment. It should be fixed first. Then, it seems, the next bug to fix will be MDEV-23116, but let's fix the first one and wait for the confirmation. | ||||||||||||||||||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2023-11-07 ] | ||||||||||||||||||||||||||||||||||||||
|
0c27922db7f is ok to push, thanks! |