[MDEV-3950] mariadb rpms should not obsolete mysql? Created: 2012-12-18  Updated: 2020-04-22

Status: Open
Project: MariaDB Server
Component/s: None
Affects Version/s: 5.5.28a
Fix Version/s: 5.5

Type: Bug Priority: Minor
Reporter: Sergei Golubchik Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: packaging

Issue Links:
Duplicate
duplicates MDEV-4562 RPM packages are wrongly marked as re... Closed
PartOf
is part of MDEV-22315 MySQL -> MariaDB upgrades Open
is part of MDEV-22329 Packages issues when upgrading Open
Relates
relates to MDEV-9584 Upgrading MariaDB 5.5 to 10.1.11 fail... Stalled

 Description   

Currently mariadb rpms obsolete mysql rpms. This allows the user to install mariadb over the existing mysql installation, without having to uninstall mysql manually first (together with all packages that depend on mysql).

There are opinions that using "obsolete" in this way is wrong. See, for example, this comment

We need to study the issue and solve it somehow, if possible.



 Comments   
Comment by Scott O'Neil [ 2014-04-22 ]

Currently, the RPMs try to use files and "Provides" that conflict with a MySQL installation on a server:

[root@master-a rpms]# rpm -ivh MariaDB-5.5.37-centos5-x86_64-* --test
error: Failed dependencies:
        MySQL conflicts with mysql-5.0.95-5.el5_9.x86_64
        MySQL conflicts with mysql-5.0.95-5.el5_9.i386
        MySQL-server conflicts with mysql-server-5.0.95-5.el5_9.x86_64
[root@master-a rpms]# 

as a result, there is no clean pathway to use RPM to handle an upgrade from MySQL -> MariaDB.

One could rpm -e to remove the pre-existing MySQL RPMs, but if there are any other packages that rely on MySQL, you'll need to use --nodeps. This will render the upgrade process non-transactional. rpm -U really is the best way to do this, and these sorts of conflicts are exactly what Obsoletes is designed to manage.

The concern described in the cited Comment in the description can be handled differently: We keep our Maria RPMs in a completely separate repository, and when we know we want a server to use Maria, we install that particular repos release RPM. This allows for us to deploy both MySQL and Maria infrastructure. However, because of the lack of comprehensive Obsoletes tags, we have no way "clean" way to programmatically handle upgrades from MySQL to Maria.

Comment by Sergei Golubchik [ 2014-04-22 ]

americanwookie, the recommended way to upgrade is to use yum. It supports transactions and can remove MySQL and install MariaDB in one transaction without breaking dependencies. While rpm is like autocommit mode, you need to have consistent state after every operation or use -nodeps.

Comment by Scott O'Neil [ 2014-04-22 ]

I agree, I'd prefer to use yum, but with the Obsoletes as it currently stands, I can't. Here's what happens:

[root@master-b ~]# yum install -y MariaDB
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: dallas.tx.mirror.xygenhosting.com
 * epel: mirror.utexas.edu
 * extras: centos.mirror.lstn.net
 * updates: mirror.beyondhosting.net
Excluding Packages from Extra Packages for Enterprise Linux 5 - x86_64
Finished
Excluding Packages from MariaDB
Finished
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package MariaDB-server.x86_64 0:5.5.37-1 set to be updated
--> Processing Dependency: MariaDB-client for package: MariaDB-server
--> Processing Dependency: MariaDB-common for package: MariaDB-server
--> Running transaction check
---> Package MariaDB-client.x86_64 0:5.5.37-1 set to be updated
---> Package MariaDB-common.x86_64 0:5.5.37-1 set to be updated
--> Processing Conflict: mysql conflicts MySQL
--> Restarting Dependency Resolution with new changes.
--> Running transaction check
---> Package MariaDB-shared.x86_64 0:5.5.37-1 set to be updated
--> Processing Dependency: libmysqlclient.so.15()(64bit) for package: perl-DBD-MySQL
--> Processing Dependency: libmysqlclient.so.15(libmysqlclient_15)(64bit) for package: perl-DBD-MySQL
--> Processing Dependency: libmysqlclient_r.so.15()(64bit) for package: collectd-mysql
--> Processing Dependency: libmysqlclient_r.so.15(libmysqlclient_15)(64bit) for package: collectd-mysql
--> Running transaction check
---> Package MariaDB-compat.x86_64 0:5.5.37-1 set to be updated
--> Finished Dependency Resolution
 
Dependencies Resolved
 
===============================================================================================================================================================================================================================
 Package                                                    Arch                                               Version                                               Repository                                           Size
===============================================================================================================================================================================================================================
Installing:
 MariaDB-server                                             x86_64                                             5.5.37-1                                              mariadb                                              43 M
     replacing  mysql-server.x86_64 5.0.95-5.el5_9
 
 MariaDB-shared                                             x86_64                                             5.5.37-1                                              mariadb                                             1.3 M
     replacing  mysql.x86_64 5.0.95-5.el5_9
 
Installing for dependencies:
 MariaDB-client                                             x86_64                                             5.5.37-1                                              mariadb                                              12 M
 MariaDB-common                                             x86_64                                             5.5.37-1                                              mariadb                                              29 k
 MariaDB-compat                                             x86_64                                             5.5.37-1                                              mariadb                                             3.4 M
 
Transaction Summary
===============================================================================================================================================================================================================================
Install       5 Package(s)
Upgrade       0 Package(s)
 
Total size: 60 M
Downloading Packages:
Running rpm_check_debug
ERROR with rpm_check_debug vs depsolve:
MySQL conflicts with mysql-5.0.95-5.el5_9.i386
Complete!
(1, [u'Please report this error in http://bugs.centos.org/yum5bug'])
[root@master-b ~]#

The crux of this problem seems to be obsoletes. For the sake of simplifying discussion, I've been using rpm directly. AFAIK, rpm is bound by the same concerns as yum when it comes to obsoletes, but rpm gives us a much simpler output/test case than yum.

Comment by Scott O'Neil [ 2014-04-22 ]

Wait, I've probably misdiagnosed this. This server has x86_64 and i386 RPMs. More troubleshooting is needed. Updates coming.

Comment by Scott O'Neil [ 2014-04-22 ]

Well, my apologies for working some troubleshooting in here. The following rpm line did the trick for me:

rpm -e mysql-5.0.95-5.el5_9.i386

I'm sure the equivalent yum comand (yum remove mysql-5.0.95-5.el5_9.i386) would've done the trick too. I'm wondering why the Obsoletes didn't catch all the architectures.

At any rate, my update here is a +1 vote for the Maria project to continue using/maintaining Obsoletes in the RPMs.

Generated at Thu Feb 08 06:52:35 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.