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

Upgrade form Percona XtraDB Cluster 5.7 fails

Details

    Description

      I tested upgrading from Percona XtraDB Cluster 5.7 to MariaDB 10.5 head. It fails due to issues in restarting the server. I suspect something is conflicting in the config and that fixing MDEV-19933 (which as had a PR pending for a while) probably sorts this out as well.

      Log https://salsa.debian.org/mariadb-team/mariadb-server/-/jobs/756114:

      Setting up mariadb-server-10.5 (1:10.5.4+maria~sid) ...
       invoke-rc.d: could not determine current runlevel
       Stopping MariaDB database server: mysqld.
       invoke-rc.d: could not determine current runlevel
       Starting MariaDB database server: mysqld . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . failed!
       invoke-rc.d: initscript mariadb, action "start" failed.
      

      Steps to reproduce:

      percona-xtradb-5.7 to mariadb-10.5 upgrade:
        stage: upgrade extras
        dependencies:
          - build
        image: debian:buster
        artifacts:
          when: always
          name: "$CI_BUILD_NAME"
          paths:
            - ${WORKING_DIR}/debug
        script:
          - sed -i "s/101/0/g" -i /usr/sbin/policy-rc.d # Enable automatic restarts from maint scripts
          - cd ${WORKING_DIR} # Don't repeat this step, it's just cd ./debian/output
          - apt-get update
          - 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
          # Verify installation of MySQL
          - dpkg -l | grep -iE 'maria|mysql|galera'
          - service mysql status
          - mysql --skip-column-names -e "SELECT @@version, @@version_comment"
          - mysql -e "SELECT Host,User,plugin,authentication_string FROM user;" mysql
          - mysql -e "SELECT * FROM plugin;" mysql
          - echo 'SHOW DATABASES;' | mysql
          # Install MariaDB built in this commit
          - sed 's/buster/sid/g' -i /etc/apt/sources.list # Enable next Debian release
          - sed '/sid-updates/d' -i /etc/apt/sources.list # Remove repositories that don't exist for Sid
          - sed '/security/d' -i /etc/apt/sources.list # Remove repositories that don't exist for Sid
          - apt-get update; apt-get install -y apt # Uprade minimal stack first
          - apt-get install -o Dpkg::Options::=--force-confnew -y ./*.deb || true # Allow to proceed so debug artifacts get collected
          # Verify installation of MariaDB built in this commit
          - dpkg -l | grep -iE 'maria|mysql|galera'
          - mariadb --version # Client version
          - service mysql status
          - mkdir -p debug # Ensure dir exists before using it
          - echo 'SHOW DATABASES;' | mariadb # List databases before upgrade are still there
          - mariadb -e "create database test; use test; create table t(a int primary key) engine=innodb; insert into t values (1); select * from t; drop table t; drop database test;" # Test InnoDB works
      

      Attachments

        Issue Links

          Activity

            The Percona upgrade path seems to fail due to the same root reason as MDEV-22678. Fixing MDEV-22678 would also fix this issue.

            otto Otto Kekäläinen added a comment - The Percona upgrade path seems to fail due to the same root reason as MDEV-22678 . Fixing MDEV-22678 would also fix this issue.

            Re-opening. Let's keep this open until "Upgrade form Percona XtraDB Cluster 5.7" works. Part of https://jira.mariadb.org/browse/MDEV-22315 tracking all upgrades that they are tested and confirmed to work.

            otto Otto Kekäläinen added a comment - Re-opening. Let's keep this open until "Upgrade form Percona XtraDB Cluster 5.7" works. Part of https://jira.mariadb.org/browse/MDEV-22315 tracking all upgrades that they are tested and confirmed to work.

            While MDEV-22678 was now fixed, Percona.com upgrades still fail for the same code/commit:

            MySQL.com works: https://salsa.debian.org/mariadb-team/mariadb-10.5/-/jobs/1040660
            Percona.com fails: https://salsa.debian.org/mariadb-team/mariadb-10.5/-/jobs/1040661

            I will need to debug this further:

            dpkg: error processing package mariadb-server-10.5 (--configure):
            1054 installed mariadb-server-10.5 package post-installation script subprocess returned error exit status 7
            

            otto Otto Kekäläinen added a comment - While MDEV-22678 was now fixed, Percona.com upgrades still fail for the same code/commit: MySQL.com works: https://salsa.debian.org/mariadb-team/mariadb-10.5/-/jobs/1040660 Percona.com fails: https://salsa.debian.org/mariadb-team/mariadb-10.5/-/jobs/1040661 I will need to debug this further: dpkg: error processing package mariadb-server-10.5 (--configure): 1054 installed mariadb-server-10.5 package post-installation script subprocess returned error exit status 7

            Failure with `export DEBIAN_SCRIPT_DEBUG=1` active:

            + '[' -f /var/lib/mysql/auto.cnf ']'
            + '[' -f /var/lib/mysql/mysql/user.MYD ']'
            + '[' '!' lsof -nt /var/lib/mysql/mysql/user.MYD ']'
            + '[' '!' -f /var/lib/mysql/undo_001 ']'
            + echo 'UPDATE mysql.user SET plugin='\''unix_socket'\'' WHERE plugin='\''auth_socket'\'';'
            + /usr/sbin/mariadbd --skip-innodb --key_buffer_size=0 --default-storage-engine=MyISAM --bootstrap
            dpkg: error processing package mariadb-server-10.5 (--configure):
             installed mariadb-server-10.5 package post-installation script subprocess returned error exit status 7
            dpkg: dependency problems prevent configuration of mariadb-server:
             mariadb-server depends on mariadb-server-10.5 (>= 1:10.5.5-2+salsaci); however:
              Package mariadb-server-10.5 is not configured yet.
            ...
             
             
            # tail /var/log/mysqld.log 
            2020-10-02  8:00:22 0 [Warning] No argument was provided to --log-bin and neither --log-basename or --log-bin-index where used;  This may cause repliction to break when this server acts as a master and has its hostname changed! Please use '--log-basename=d925739d9e4b' or '--log-bin=mysqld-bin' to avoid this problem.
            2020-10-02  8:00:22 0 [Note] Plugin 'InnoDB' is disabled.
            2020-10-02  8:00:22 0 [Note] Plugin 'FEEDBACK' is disabled.
            2020-10-02  8:00:22 0 [ERROR] /usr/sbin/mariadbd: unknown variable 'pxc_strict_mode=ENFORCING'
            2020-10-02  8:00:22 0 [ERROR] Aborting
             
             
            /etc/mysql# grep -rF pxc_strict_mode *
            percona-xtradb-cluster.conf.d/wsrep.cnf:#pxc_strict_mode allowed values: DISABLED,PERMISSIVE,ENFORCING,MASTER
            percona-xtradb-cluster.conf.d/wsrep.cnf:pxc_strict_mode=ENFORCING
             
             
            # ls -la /etc/alternatives/my.cnf
            lrwxrwxrwx 1 root root 37 Oct  2 07:57 /etc/alternatives/my.cnf -> /etc/mysql/percona-xtradb-cluster.cnf
             
             
            # cat /etc/mysql/percona-xtradb-cluster.cnf
            #
            # The Percona XtraDB Cluster 5.7 configuration file.
            #
            #
            # * IMPORTANT: Additional settings that can override those from this file!
            #   The files must end with '.cnf', otherwise they'll be ignored.
            #   Please make any edits and changes to the appropriate sectional files
            #   included below.
            #
            !includedir /etc/mysql/conf.d/
            !includedir /etc/mysql/percona-xtradb-cluster.conf.d/
            

            The root cause here is that the command `update-alternatives --install /etc/mysql/my.cnf my.cnf /etc/mysql/mariadb.cnf 200` does not register the new my.cnf as the priority number is too low. I'll figure out a way to force it now.

            otto Otto Kekäläinen added a comment - Failure with `export DEBIAN_SCRIPT_DEBUG=1` active: + '[' -f /var/lib/mysql/auto.cnf ']' + '[' -f /var/lib/mysql/mysql/user.MYD ']' + '[' '!' lsof -nt /var/lib/mysql/mysql/user.MYD ']' + '[' '!' -f /var/lib/mysql/undo_001 ']' + echo 'UPDATE mysql.user SET plugin='\''unix_socket'\'' WHERE plugin='\''auth_socket'\'';' + /usr/sbin/mariadbd --skip-innodb --key_buffer_size=0 --default-storage-engine=MyISAM --bootstrap dpkg: error processing package mariadb-server-10.5 (--configure): installed mariadb-server-10.5 package post-installation script subprocess returned error exit status 7 dpkg: dependency problems prevent configuration of mariadb-server: mariadb-server depends on mariadb-server-10.5 (>= 1:10.5.5-2+salsaci); however: Package mariadb-server-10.5 is not configured yet. ...     # tail /var/log/mysqld.log 2020-10-02 8:00:22 0 [Warning] No argument was provided to --log-bin and neither --log-basename or --log-bin-index where used; This may cause repliction to break when this server acts as a master and has its hostname changed! Please use '--log-basename=d925739d9e4b' or '--log-bin=mysqld-bin' to avoid this problem. 2020-10-02 8:00:22 0 [Note] Plugin 'InnoDB' is disabled. 2020-10-02 8:00:22 0 [Note] Plugin 'FEEDBACK' is disabled. 2020-10-02 8:00:22 0 [ERROR] /usr/sbin/mariadbd: unknown variable 'pxc_strict_mode=ENFORCING' 2020-10-02 8:00:22 0 [ERROR] Aborting     /etc/mysql# grep -rF pxc_strict_mode * percona-xtradb-cluster.conf.d/wsrep.cnf:#pxc_strict_mode allowed values: DISABLED,PERMISSIVE,ENFORCING,MASTER percona-xtradb-cluster.conf.d/wsrep.cnf:pxc_strict_mode=ENFORCING     # ls -la /etc/alternatives/my.cnf lrwxrwxrwx 1 root root 37 Oct 2 07:57 /etc/alternatives/my.cnf -> /etc/mysql/percona-xtradb-cluster.cnf     # cat /etc/mysql/percona-xtradb-cluster.cnf # # The Percona XtraDB Cluster 5.7 configuration file. # # # * IMPORTANT: Additional settings that can override those from this file! # The files must end with '.cnf', otherwise they'll be ignored. # Please make any edits and changes to the appropriate sectional files # included below. # !includedir /etc/mysql/conf.d/ !includedir /etc/mysql/percona-xtradb-cluster.conf.d/ The root cause here is that the command `update-alternatives --install /etc/mysql/my.cnf my.cnf /etc/mysql/mariadb.cnf 200` does not register the new my.cnf as the priority number is too low. I'll figure out a way to force it now.

            I fixed this in a3448b2395a4f7aff62f8bab70797a6f928d626f.

            Ever since the Salsa-CI tests have ensured that Percona upgrades continue to work and don't regress:

            otto Otto Kekäläinen added a comment - I fixed this in a3448b2395a4f7aff62f8bab70797a6f928d626f. Ever since the Salsa-CI tests have ensured that Percona upgrades continue to work and don't regress:

            People

              otto Otto Kekäläinen
              otto Otto Kekäläinen
              Votes:
              0 Vote for this issue
              Watchers:
              4 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.