Dotdeb is a repository currently targeting Debian and Ubuntu, providing a nice set of packages for LAMP servers.

Recently, MySQL 5.6 was added to the dotdeb repository. On the surface, this is a very harmless addition. MariaDB is a replacement for MySQL and it should be possible for applications designed for MySQL to easily switch to MariaDB. Therefore MariaDB also includes the libraries that applications using MySQL depend upon, such as libmysqlclient18 and mysql-common. The dpkg package manager looks at the MySQL 5.6 packages in dotdeb and assumes that 5.6 is a higher version than 5.5, which results in it removing or replacing libraries during normal apt-get installation and upgrade procedures.

The problems appear in the following scenarios:

  1. apt-get install mariadb-server-5.5 (fresh or over a previous version)
  2. apt-get upgrade (if MariaDB 5.5 is installed)
  3. apt-get dist-upgrade (if MariaDB 5.5 is installed)

Scenario 3, dist-upgrade, is especially nasty because in its attempt to upgrade the libmysqlclient18 and mysql-common packages, dpkg will REMOVE MariaDB.

MySQL 5.5 users are also affected in a similar way although the consequences look to be a bit lighter. Our early tests show for example that dist-upgrade will upgrade MySQL 5.5 to MySQL 5.6, which might come as a surprise. MySQL 5.5 users should therefore double-check how they are affected.

See below for examples of what these problems look like in practice. It is also worth noting that the problems do NOT exist if you are using MariaDB 10.0. With MariaDB 10.0 all the listed scenarios work just fine. MariaDB 10.0 is GA now and therefore a good alternative.

Solution

Fortunately there is a workaround that can be used and has been proven to work. By pinning the MariaDB repository you can override the normal behavior (where the highest version number wins). The process is simple. You only need to add a preferences file (with a .pref extension) for the MariaDB repository under the /etc/apt/preferences.d/ directory. The contents should look similar to the following:

The value of Pin-Priority must be at least 1000. Also note that the Pin: row needs to have the domain name of the repository that you are using for your MariaDB apt sources file entry. In this example the domain is ftp.osuosl.org.

With the preference file in place the packages in the MariaDB repository will be preferred over the similarly named packages in the dotdeb repository and the problematic scenarios listed above will work just fine.

Many thanks to our users who promptly reported the problem on IRC, helped to find the root cause and experimented with the workaround!

Examples of the problematic scenarios

Scenario 1: Fresh installation or installation over a previous version of MariaDB 5.5
Result: Fails

Scenario 2: apt-get upgrade
Result: MariaDB server and client are not upgraded

Scenario 3: apt-get dist-upgrade
Result: mariadb-server and mariadb-client are removed

On Thursday MySQL technology saw a huge boost. It’s hard for anyone now to argue that MySQL isn’t in the game of extreme scalability and performance, which some NoSQL vendors have been using as a tagline for the last years. To see four of the largest MySQL and MariaDB users come together to bootstrap a branch of MySQL for extreme scaling needs is simply fantastic. The improvements done inside these companies will now be available to the rest of the community. In all fairness Facebook and Twitter, in particular, have been making their improvements publicly available also before. Google has also made some improvements available publicly over the years and have lately been active in the MariaDB project with code reviews, bug fixes and other patches. But broadening the public contributions further and combining it all, is new.

Engineering of MySQL technology happens in many places. Aside from Oracle and the companies behind WebScaleSQL, there are two other entities that have made significant contributions to improving MySQL technology in recent years – Percona and MariaDB. Percona has made many performance-related functionality and tooling improvements. The MariaDB project has made significant engineering efforts by bringing out many new features to MySQL technology and has also become the project for community contributions. Take a look at the list of bigger contributions that have made it into MariaDB 10.0.

MariaDB 5.5 is constantly being merged with MySQL 5.5 community edition. Every time there is a new minor release of MySQL 5.5 a new release of MariaDB 5.5 with exactly the same number comes out shortly afterwards. In MariaDB 10, this dependency is lighter, which the numbering also indicates. MariaDB 10 includes a lot of merged code from MySQL 5.6, but it also includes a big amount of MariaDB specific code and code merged from the wider community. WebScaleSQL will be another important source for merges in the future. Without knowing all the details of WebScaleSQL, it should be safe to say that there are two sorts of patches: the ones that improve MySQL technology in general and the ones that would be specific for the purposes of running MySQL at extreme scale with integration into technologies not commonly used in more normal setups of MySQL or MariaDB.

MariaDB is all about improving and keeping the world’s most installed database, MySQL, available to the masses independent of whether they are private persons with the need for a database for their blog or if the target is a mission critical enterprise application. MariaDB therefore needs to provide all the components needed from database drivers (connectors) to integrated high-availability solutions like MariaDB Galera Cluster.

In addition, the majority of the users and organizations using MariaDB or MySQL don’t have the in-house skills to build and make changes to MariaDB or MySQL. This is why MariaDB has to be supported on a wide variety of platforms and binaries provided for all of them. WebScaleSQL is currently only compatible with GNU/Linux x86_64 platforms and no binaries are produced.

WebScaleSQL confirms the power of community driven development in open source and is a very nice addition to the branches and forks of MySQL!

MariaDB 10 is nearing GA, and it makes sense to make sure that the test suite from MySQL 5.6 is merged into MariaDB 10. Svoj is doing a lot of this work, and then we like to look at features, especially ones that are deprecated upstream. We don’t do that on blogs, but on the maria-developers mailing list.

I bring to your attention: Intermediate status for test cases merge. We see that INSERT DELAYED and SHOW PROFILE for example are deprecated in MySQL 5.6. The only way for feedback to the MySQL team seems to be comments on Morgan’s blog. However with MariaDB, especially with the feedback plugin enabled, we have an additional layer of information besides just comments on a blog or mailing list. 

We see from the features being used, INSERT DELAYED and SHOW PROFILE are still being used. The rest of the thread is an interesting read, as for example we should probably follow 5.6 in making NO_ENGINE_SUBSTITUTION to be the default. Also if you’re interested in the reason behind YEAR(2) existing, there is reasoning to why it exists.

The list continues. If you’re interested in MariaDB development, please ensure that you’re subscribed to the maria-developers mailing list, and if you’re a user, please consider enabling the user feedback plugin.