[MDEV-26850] Repository upgrade silently removes my.cnf Created: 2021-10-18 Updated: 2022-09-07 |
|
| Status: | In Testing |
| Project: | MariaDB Server |
| Component/s: | Configuration, Packaging, Upgrades |
| Affects Version/s: | 10.5, 10.6 |
| Fix Version/s: | 10.5, 10.6 |
| Type: | Bug | Priority: | Major |
| Reporter: | Oli Sennhauser | Assignee: | Otto Kekäläinen |
| Resolution: | Unresolved | Votes: | 2 |
| Labels: | 10.5, packaging, upgrade | ||
| Issue Links: |
|
||||||||
| Description |
|
When we used MariaDB repository installations and upgraded from 10.3 to 10.5 the installation script silently removed our my.cnf file (does NO backup!). Before upgrade:
after upgrade:
It is pretty nasty that the file was removed at all and that it did not creates at least a backup and outputs a warning!!! At least! |
| Comments |
| Comment by Alexey Bychko (Inactive) [ 2021-10-19 ] | ||||||||||||
|
oli, as far as I know the design - you shouldn't think about the shipped config files, instead you have to create custom file under /etc/mariadb.conf.d. | ||||||||||||
| Comment by Alexey Bychko (Inactive) [ 2021-10-25 ] | ||||||||||||
|
closing because those config files are just version-specific defaults and shouldn't be edited | ||||||||||||
| Comment by Sergei Golubchik [ 2021-10-26 ] | ||||||||||||
|
otto, is there something we can change in packaging so that when a new my.cnf/mariadb.conf is installed, the old is is preserved as a backup? Something like RPM's %config, but not like %config(noreplace). | ||||||||||||
| Comment by Oli Sennhauser [ 2021-11-04 ] | ||||||||||||
|
Steps to reproduce according to you download page:
Reading package lists... Done
drwxr-xr-x 2 root root 4096 Nov 4 12:05 /etc/mysql/conf.d --> My changes in my.cnf where gone! | ||||||||||||
| Comment by Faustin Lammler [ 2021-11-04 ] | ||||||||||||
|
Thanks oli, I have tested and I can confirm the same behavior in containers (Debian10 and Ubuntu20.04). I did some research and it seems that this was introduced by the following commit: I am not sure at this point how we could handle this because it seems that there are various options and I'll wait for otto to comment. Note that the upgrade from Debian 10.3 version (where /etc/mysql/my.cnf is already a symlink to /etc/alternatives/my.cnf) to MDBF 10.5 version seems to correctly handle this (at least the user receive a warning):
Anyway this behavior is not only problematic for users (potential loose of previous configurations), it also does not respect the Debian policy. > Configuration file handling must conform to the following behavior: | ||||||||||||
| Comment by Daniel Black [ 2021-11-05 ] | ||||||||||||
|
I agree that a user's config change should be preserved. I don't want the crazy selection of Debian specific defaults partially fixed in 7c2079f600ba to propagate on upgrade. Moving a config file if its content doesn't match a set of hashes (corresponding to old defaults) is my preference at the moment. | ||||||||||||
| Comment by Otto Kekäläinen [ 2021-11-05 ] | ||||||||||||
|
Yes, naturally the config should be preserved. This is just a bug that is happening now. Thanks oli for supplying exact steps to reproduce. I will look into this now. | ||||||||||||
| Comment by Otto Kekäläinen [ 2021-11-05 ] | ||||||||||||
|
I have potentially found the root cause and have a fix in https://github.com/MariaDB/server/pull/1944, but I have not yet tested this. I will do that probably in the weekend. |