Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-22694

New -compat RPM package breaks certain upgrades

Details

    Description

      With 10.4.13 MariaDB RPM repositories introduced a new package, MariaDB-compat. While the idea of changing packaging amidst a stable mainline is already ridiculous, this new package breaks MariaDB upgrade whenever a hybrid, MariaDB + MySQL system is present. The change is completely unannounced and, its present form, does more harm than good.

      There are real-life cases when a vendor links its product to specific versions of libmysqlclient which are not provided by MariaDB. One such example is Zabbix. Version 4 required libmysqlclient 20 and version 5 requires libmysqlclient 21. For both of these to run, one had to install real MySQL packages - either from Oracle (on RHEL-7) or from RedHat (on RHEL-8). To make it clear, MariaDB still only ships libmysqlclient 18 as of MariaDB-common-10.4.13.

      Since MariaDB packaging does not conflict with neither Oracle's nor RedHat's one for MySQL, it was quite possible to have on the same OS instance a MariaDB server alongside a client that is forced to use MySQL libraries (e.g., Zabbix server connecting to a local MariaDB server).

      Typically, the -compat packages provide older version of a given library for older software to work with; glibc-compat and g++-compat are well known examples. Thew newly introduced MariaDB-compat provides libmysqlclient 15, 16 and 18. While these may be needed, it also obsoletes a package named mysql-libs, which is - intentionally? - the name of the MySQL's package that contains the current version of libmysqlclient, 21.Therefore we now have a -compat package with older versions of a library which removes another package with the current version of the same library. This is, of course, quite a bad behavior.

      The quick solution for such cases is to blacklist the MariaDB-compat package which is useless anyway. Long term, however, MariaDB should fix its packaging and not obsolete a foreign package which provides a more current version of the same library.

      Attachments

        Issue Links

          Activity

            serg please take a look

            abychko Alexey Bychko (Inactive) added a comment - serg please take a look

            MariaDB-compat existed pretty much always, since 5.5. Because of the bug (MDEV-22078) it failed to build specifically on RHEL8 and CentOS8. The bug was fixed in 10.3.23 and 10.4.13.

            You don't have to install it on RHEL8, so just don't.

            serg Sergei Golubchik added a comment - MariaDB-compat existed pretty much always, since 5.5. Because of the bug ( MDEV-22078 ) it failed to build specifically on RHEL8 and CentOS8. The bug was fixed in 10.3.23 and 10.4.13. You don't have to install it on RHEL8, so just don't.

            I do not install it, of course - but it still breaks things. Yes, this is how "Obsoletes: " property of an RPM package works:

            if you have a package "mysql-libs" installed and if a new package "MariaDB-compat" suddenly comes into the repo (where it had been missing so far), then on your next "yum update" (to patch your OS once a week) you will get MariaDB-compat automatically replacing "mysql-libs" exactly because the former package "obsoletes" the latter. (This is the intended and documented behaviour of "Obsoletes:" in the RPM world.)

            Of course, such an update will fail, since "mysql-libs" provides (as in PRM "Provides: ") libmysqlclient.so.21 which is required by a third-party package and is missing in MariaDB-compat. Which means that from this point on you cannot patch your OS automatically, but only manually, painstakingly listing on the yum command line all packages to update - just because "MariaDB-compat" has a wrong and useless "Obsoletes:" in its spec.

            So, I still insist that "MariaDB-compat" should not try to obsolete a foreign package.

            assen.totin Assen Totin (Inactive) added a comment - I do not install it, of course - but it still breaks things. Yes, this is how "Obsoletes: " property of an RPM package works: if you have a package "mysql-libs" installed and if a new package "MariaDB-compat" suddenly comes into the repo (where it had been missing so far), then on your next "yum update" (to patch your OS once a week) you will get MariaDB-compat automatically replacing "mysql-libs" exactly because the former package "obsoletes" the latter. (This is the intended and documented behaviour of "Obsoletes:" in the RPM world.) Of course, such an update will fail, since "mysql-libs" provides (as in PRM "Provides: ") libmysqlclient.so.21 which is required by a third-party package and is missing in MariaDB-compat. Which means that from this point on you cannot patch your OS automatically, but only manually, painstakingly listing on the yum command line all packages to update - just because "MariaDB-compat" has a wrong and useless "Obsoletes:" in its spec. So, I still insist that "MariaDB-compat" should not try to obsolete a foreign package.

            It should, and in CentOS 6 and 7 it was a required package that any other MariaDB-* package was depending on. Because postfix needed mysql-libs, and installing MariaDB should not remove postfix, it should replace mysql-libs while keeping postfix in a working condition.

            I think we can specify that MariaDB-compat obsoletes only mysql-libs < 8.0, I've checked Oracle mysql-community-libs and RedHat's mysql-libs 8.0 packages and it seems there should be no file level conflicts (which was the only reason why we have this "Obsoletes")

            serg Sergei Golubchik added a comment - It should, and in CentOS 6 and 7 it was a required package that any other MariaDB-* package was depending on. Because postfix needed mysql-libs, and installing MariaDB should not remove postfix, it should replace mysql-libs while keeping postfix in a working condition. I think we can specify that MariaDB-compat obsoletes only mysql-libs < 8.0, I've checked Oracle mysql-community-libs and RedHat's mysql-libs 8.0 packages and it seems there should be no file level conflicts (which was the only reason why we have this "Obsoletes")

            This has to wait till the next release, unfortunately.

            The fix requires changes in 10.1 metadata (because -compat in 10.4 is just a repackaged 10.1) and while 10.1 metadata don't exactly make sense (it provides mysql-libs = 1:10.1.17-1.el7.centos) it's too risky to change, some packages might require this. As 10.1 was doing it for five years already. But 10.1 reaches EOL in October this year, as soon as we build the last release I'll change the metadata to have -compat packages fixed.

            serg Sergei Golubchik added a comment - This has to wait till the next release, unfortunately. The fix requires changes in 10.1 metadata (because -compat in 10.4 is just a repackaged 10.1) and while 10.1 metadata don't exactly make sense (it provides mysql-libs = 1:10.1.17-1.el7.centos ) it's too risky to change, some packages might require this. As 10.1 was doing it for five years already. But 10.1 reaches EOL in October this year, as soon as we build the last release I'll change the metadata to have -compat packages fixed.

            assen.totin, do you mean it worked before 10.4.13? Like, with 10.4.12?

            I cannot install mysql-libs-8.0.21 and MariaDB-shared-10.4.16 in parallel on RHEL8 even without MariaDB-compat.
            Because MariaDB-shared requires MariaDB-common of the same version and mysql-libs require mysql-common of the same version.
            And two *-common packages conflict, they cannot be installed in parallel.

            So how did you manage to do it with 10.4.12?

            serg Sergei Golubchik added a comment - assen.totin , do you mean it worked before 10.4.13? Like, with 10.4.12? I cannot install mysql-libs-8.0.21 and MariaDB-shared-10.4.16 in parallel on RHEL8 even without MariaDB-compat. Because MariaDB-shared requires MariaDB-common of the same version and mysql-libs require mysql-common of the same version. And two *-common packages conflict, they cannot be installed in parallel. So how did you manage to do it with 10.4.12?
            assen.totin Assen Totin (Inactive) added a comment - - edited

            Here is what I have on a real-life system:

            root@cgdczbx1 assen.totin]# cat /etc/redhat-release 
            Red Hat Enterprise Linux release 8.2 (Ootpa)
             
            [root@cgdczbx1 assen.totin]# rpm -qa | grep -i mysql
            zabbix-server-mysql-5.0.4-1.el8.x86_64
            zabbix-web-mysql-5.0.4-1.el8.noarch
            php-mysqlnd-7.2.24-1.module+el8.2.0+4601+7c76a223.x86_64
            mysql-libs-8.0.17-3.module+el8.0.0+3898+e09bb8de.x86_64
             
            [root@cgdczbx1 assen.totin]# rpm -qa | grep -i mariadb
            MariaDB-server-10.4.15-1.el8.x86_64
            MariaDB-common-10.4.15-1.el8.x86_64
            MariaDB-shared-10.4.15-1.el8.x86_64
            MariaDB-client-10.4.15-1.el8.x86_64
            MariaDB-backup-10.4.15-1.el8.x86_64
            

            It does take some wiggling because MariaDB packages are still not modular and therefor YUM hides them if either mysql or mariadb module is enabled - so they both have to be disabled in order to install MariaDB, but the mysql module will need to be enabled (back) in order to install their package (which becomes a hard dependency for Zabbix since our version of libmysqlclient.so is too old for them).

            I had the system installed with 10.4.12 and on the upgrade to 10.4.13 it broke, so I had to do something like this; after that upgrade have been going fine and I'm now on 10.4.15:

            [root@cgdczbx1 assen.totin]# cat /etc/yum.conf 
            ...
            exclude=MariaDB-compat
            

            assen.totin Assen Totin (Inactive) added a comment - - edited Here is what I have on a real-life system: root@cgdczbx1 assen.totin]# cat /etc/redhat-release Red Hat Enterprise Linux release 8.2 (Ootpa)   [root@cgdczbx1 assen.totin]# rpm -qa | grep -i mysql zabbix-server-mysql-5.0.4-1.el8.x86_64 zabbix-web-mysql-5.0.4-1.el8.noarch php-mysqlnd-7.2.24-1.module+el8.2.0+4601+7c76a223.x86_64 mysql-libs-8.0.17-3.module+el8.0.0+3898+e09bb8de.x86_64   [root@cgdczbx1 assen.totin]# rpm -qa | grep -i mariadb MariaDB-server-10.4.15-1.el8.x86_64 MariaDB-common-10.4.15-1.el8.x86_64 MariaDB-shared-10.4.15-1.el8.x86_64 MariaDB-client-10.4.15-1.el8.x86_64 MariaDB-backup-10.4.15-1.el8.x86_64 It does take some wiggling because MariaDB packages are still not modular and therefor YUM hides them if either mysql or mariadb module is enabled - so they both have to be disabled in order to install MariaDB, but the mysql module will need to be enabled (back) in order to install their package (which becomes a hard dependency for Zabbix since our version of libmysqlclient.so is too old for them). I had the system installed with 10.4.12 and on the upgrade to 10.4.13 it broke, so I had to do something like this; after that upgrade have been going fine and I'm now on 10.4.15: [root@cgdczbx1 assen.totin]# cat /etc/yum.conf ... exclude=MariaDB-compat

            People

              serg Sergei Golubchik
              assen.totin Assen Totin (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.