[MDEV-26567] Attempt to remove non-existing mariadb-libs causes removal of entire MariaDB installation Created: 2021-09-07  Updated: 2023-04-27

Status: Open
Project: MariaDB Server
Component/s: Platform RedHat
Affects Version/s: 10.2, 10.3, 10.4, 10.5, 10.6
Fix Version/s: 10.4, 10.5, 10.6

Type: Bug Priority: Major
Reporter: Elena Stepanova Assignee: Sergei Golubchik
Resolution: Unresolved Votes: 0
Labels: None
Environment:

RHEL/CentOS 7



 Description   

Courtesy of tturenko's tests


RHEL 7 and CentOS 7 have a package called mariadb-libs in the default installation:

mariadb-libs-5.5.56-2.el7.x86_64

It used to cause troubles for our installation, so our packaging is now aware of it in the form of (at least)

  IF(RPM MATCHES "(rhel|centos)[67]")
    SET(CPACK_RPM_common_PACKAGE_REQUIRES "MariaDB-compat")
    SET(CPACK_RPM_compat_PACKAGE_CONFLICTS "mariadb-libs < 1:10.1.0")
  ENDIF()

However, it causes a weird effect, which is probably unexpected and likely undesired.

Let's say I remove the package first, before installing any MariaDB packages. It removes easily and only pulls postfix along:

[buildbot@centos74-amd64 ~]$ rpm -qa | grep mariadb-libs
mariadb-libs-5.5.56-2.el7.x86_64
[buildbot@centos74-amd64 ~]$ sudo yum remove -y mariadb-libs
Loaded plugins: fastestmirror
Resolving Dependencies
--> Running transaction check
---> Package mariadb-libs.x86_64 1:5.5.56-2.el7 will be erased
--> Processing Dependency: libmysqlclient.so.18()(64bit) for package: 2:postfix-2.10.1-6.el7.x86_64
--> Processing Dependency: libmysqlclient.so.18(libmysqlclient_18)(64bit) for package: 2:postfix-2.10.1-6.el7.x86_64
--> Running transaction check
---> Package postfix.x86_64 2:2.10.1-6.el7 will be erased
--> Finished Dependency Resolution
 
Dependencies Resolved
 
=============================================================================================================================================================================================================================================
 Package                                                    Arch                                                 Version                                                       Repository                                               Size
=============================================================================================================================================================================================================================================
Removing:
 mariadb-libs                                               x86_64                                               1:5.5.56-2.el7                                                @anaconda                                               4.4 M
Removing for dependencies:
 postfix                                                    x86_64                                               2:2.10.1-6.el7                                                @anaconda                                                12 M
 
Transaction Summary
=============================================================================================================================================================================================================================================
Remove  1 Package (+1 Dependent package)
 
Installed size: 17 M
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Erasing    : 2:postfix-2.10.1-6.el7.x86_64                                                                                                                                                                                             1/2 
  Erasing    : 1:mariadb-libs-5.5.56-2.el7.x86_64                                                                                                                                                                                        2/2 
  Verifying  : 1:mariadb-libs-5.5.56-2.el7.x86_64                                                                                                                                                                                        1/2 
  Verifying  : 2:postfix-2.10.1-6.el7.x86_64                                                                                                                                                                                             2/2 
 
Removed:
  mariadb-libs.x86_64 1:5.5.56-2.el7                                                                                                                                                                                                         
 
Dependency Removed:
  postfix.x86_64 2:2.10.1-6.el7                                                                                                                                                                                                              
 
Complete!

Then I install a bunch of MariaDB packages, they install all right.
There is still no mariadb-libs of course.
But if I try to remove it, instead yum removes our MariaDB-compat, which in turns pulls together the whole installed set:

[buildbot@centos74-amd64 ~]$ rpm -qa | grep mariadb-libs
[buildbot@centos74-amd64 ~]$ sudo yum remove -y mariadb-libs
Loaded plugins: fastestmirror
Resolving Dependencies
--> Running transaction check
---> Package MariaDB-compat.x86_64 0:10.5.12-1.el7.centos will be erased
--> Processing Dependency: MariaDB-compat for package: MariaDB-common-10.5.12-1.el7.centos.x86_64
--> Running transaction check
---> Package MariaDB-common.x86_64 0:10.5.12-1.el7.centos will be erased
--> Processing Dependency: MariaDB-common for package: MariaDB-shared-10.5.12-1.el7.centos.x86_64
--> Processing Dependency: MariaDB-common for package: MariaDB-server-10.5.12-1.el7.centos.x86_64
--> Processing Dependency: MariaDB-common for package: MariaDB-client-10.5.12-1.el7.centos.x86_64
--> Processing Dependency: MariaDB-common for package: MariaDB-devel-10.5.12-1.el7.centos.x86_64
--> Processing Dependency: MariaDB-common for package: MariaDB-backup-10.5.12-1.el7.centos.x86_64
...

I only checked 10.5 and 10.6, but the packaging logic looks the same everywhere.



 Comments   
Comment by Alexey Bychko (Inactive) [ 2021-09-08 ]

well, it's not truly non-existing. compat package must provide everything what provided replaced packages.
for example:

rpm -qp --provides MariaDB-compat-10.6.5_2-1.el7_9.x86_64.rpm
...
mariadb-libs = 1:10.1.48-1.el7.centos
mariadb-libs(x86-64) = 1:10.1.48-1.el7.centos
config(mariadb-libs) = 1:10.1.48-1.el7.centos
mysql-libs = 1:10.1.48-1.el7.centos
mysql-libs(x86-64) = 1:10.1.48-1.el7.centos
config(mysql-libs) = 1:10.1.48-1.el7.centos
...

so, your request to uninstall mariadb-libs erases everything that provides mariadb-libs and also deletes all dependent packages

Generated at Thu Feb 08 09:46:17 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.