Skip to content
Snippets Groups Projects
Commit 13e3a790 authored by Otto Kekäläinen's avatar Otto Kekäläinen
Browse files

Fix upgrade from Percona.com by ensuring server uses mariadb.cnf

Ensure mariadb.cnf is always used after mariadb-common is installed.
This is needed to be able to upgrade form Percona XtraDB Cluster to
MariaDB. Without it the mariadbd would try to read Percona specific
configuration options and fail to even start.

Also extend docs with some debugging tips.
parent 3ddbe138
No related branches found
No related tags found
No related merge requests found
Pipeline #182598 passed with warnings with stages
in 2 hours, 26 minutes, and 35 seconds
......@@ -172,3 +172,19 @@ the build will complete and not abort if any of those debug steps fail.
If there is a core dump file a stack trace can be produced with:
cd $(BUILDDIR)/mysql-test && gdb --batch --ex 'thr a a bt' var/log/*/mysqld.1/core || true
## Debug installation/upgrade
To see what exactly the Debian maintainer scripts run, a verbose debug mode can be enabled with:
export DEBIAN_SCRIPT_DEBUG=1
apt instal ...
The source files of the Debian maintainer scripts are not the final ones, as the package building stage may make changes and additions to them. To view a maintainer script in the final form run on installed system:
cat /var/lib/dpkg/info/mariadb-server-10.5.postinst
To review the my.cnf status you may run:
find /etc/mysql/ -ls
update-alternatives --display my.cnf
......@@ -23,6 +23,18 @@ case "$1" in
echo " ln -sf mariadb.cnf /etc/mysql/my.cnf"
fi
fi
# Note that MySQL in Debian runs the configure-symlinks from the
# mysql-server-x.x.postinst and postrm files, while the MySQL.com (and
# Percona.com) packaging triggers update-alternatives directly form the
# mysql-common (and percona-x-common) package using priority 200.
#
# Thus, we need to ensure here that mariadb.cnf indeed became the primary
# alternative and override with priority 500 if needed.
if ! update-alternatives --query my.cnf | grep --quiet "Value: /etc/mysql/mariadb.cnf"
then
update-alternatives --install /etc/mysql/my.cnf my.cnf "/etc/mysql/mariadb.cnf" 500 || true
fi
;;
esac
......
......@@ -695,11 +695,12 @@ mysql.com-5.7 to mariadb-10.5 upgrade (MDEV-22678):
- ${WORKING_DIR}/debug
script:
- *test-prepare-container
- apt-get install --no-install-recommends --yes gpg gpg-agent dirmngr ca-certificates # Bare minimal (<4MB) for apt-key to work
- apt-key adv --recv-keys --keyserver hkps://keyserver.ubuntu.com:443 8C718D3B5072E1F5
- echo 'deb https://repo.mysql.com/apt/debian/ buster mysql-5.7' > /etc/apt/sources.list.d/mysql.list
- apt-get update
- apt-get install -y mysql-server
- |
apt-get install --no-install-recommends --yes gpg gpg-agent dirmngr ca-certificates # Bare minimal (<4MB) for apt-key to work
apt-key adv --recv-keys --keyserver hkps://keyserver.ubuntu.com:443 8C718D3B5072E1F5
echo 'deb https://repo.mysql.com/apt/debian/ buster mysql-5.7' > /etc/apt/sources.list.d/mysql.list
apt-get update
apt-get install -y mysql-server
- *test-verify-initial
# Enable backports to make galera-4 available
- echo 'deb http://deb.debian.org/debian buster-backports main' >> /etc/apt/sources.list.d/backports.list && apt-get update
......@@ -712,7 +713,6 @@ mysql.com-5.7 to mariadb-10.5 upgrade (MDEV-22678):
except:
variables:
- $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/
allow_failure: true
percona-xtradb-5.7 to mariadb-10.5 upgrade (MDEV-22679):
stage: upgrade extras
......@@ -727,11 +727,12 @@ percona-xtradb-5.7 to mariadb-10.5 upgrade (MDEV-22679):
- ${WORKING_DIR}/debug
script:
- *test-prepare-container
- apt-get install --no-install-recommends --yes gpg gpg-agent dirmngr ca-certificates # Bare minimal (<4MB) for apt-key to work
- apt-key adv --recv-keys --keyserver hkps://keyserver.ubuntu.com:443 9334A25F8507EFA5
- echo 'deb https://repo.percona.com/apt/ buster main' > /etc/apt/sources.list.d/mysql.list
- apt-get update
- apt-get install -y percona-xtradb-cluster-57
- |
apt-get install --no-install-recommends --yes gpg gpg-agent dirmngr ca-certificates # Bare minimal (<4MB) for apt-key to work
apt-key adv --recv-keys --keyserver hkps://keyserver.ubuntu.com:443 9334A25F8507EFA5
echo 'deb https://repo.percona.com/apt/ buster main' > /etc/apt/sources.list.d/mysql.list
apt-get update
apt-get install -y percona-xtradb-cluster-57
- service mysql status
- *test-verify-initial
# Enable backports to make galera-4 available
......@@ -745,4 +746,3 @@ percona-xtradb-5.7 to mariadb-10.5 upgrade (MDEV-22679):
except:
variables:
- $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/
allow_failure: true
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment