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

Corrupt database with MariaDB 10.4.10 (see: MDEV-20987)

    XMLWordPrintable

Details

    Description

      We are still experiencing the issue first reported with MDEV-20987, even with MariaDB 10.4.10. After MariaDB and/or the server is rebooted, we see errors like "Table 'relution.scheduler_task' doesn't exist in engine".

      Steps for reproduction
      Base installation

      • Create new virtual machine
        • "CentOS 7.x / MariaDB 10.4.x"
        • Linux
        • Red Hat (64-bit)
        • 4096 MB base memory
        • 20 GB SSD
      • Install CentOS
        • CentOS-7-x86_64-Minimal-1804.iso
        • Minimal Install
        • Automatic partitioning
        • Wired network
        • Create user during installation ("relution")
      • Reboot

      Post-Installation steps

      • yum -y update
      • lsb_release -a
        • LSB Version: :core-4.1-amd64:core-4.1-noarch:cxx-4.1-amd64:cxx-4.1-noarch:desktop-4.1-amd64:desktop-4.1-noarch:languages-4.1-amd64:languages-4.1-noarch:printing-4.1-amd64:printing-4.1-noarch
        • Distributor ID: CentOS
        • Description: CentOS Linux release 7.7.1908 (Core)
        • Release: 7.7.1908
        • Codename: Core
      • Reboot

      Install MariaDB

      • Create /etc/yum.repos.d/MariaDB.repo

        # MariaDB 10.4 CentOS repository list - created 2019-12-05 10:15 UTC
        # http://downloads.mariadb.org/mariadb/repositories/
        [mariadb]
        name = MariaDB
        baseurl = http://yum.mariadb.org/10.4/centos7-amd64
        gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
        gpgcheck=1
        

      • yum -y install mariadb-server mariadb
      • mariadb --version

        mariadb  Ver 15.1 Distrib 10.4.10-MariaDB, for Linux (x86_64) using readline 5.1
        

      Configure MariaDB for application

      • Create /etc/my.cnf.d/relution.cnf

        [mysqld]
        collation-server=utf8mb4_general_ci
        character-set-server=utf8mb4
        max_allowed_packet=1G
        innodb_file_per_table=1
        

      • systemctl start mariadb.service
      • systemctl enable mariadb.service

      Install application

      Create initial database

      • Create /opt/create_database.sh =>

        #!/bin/bash
        if [[ $# -ne 2 ]]; then
            echo "Usage: $0 <database> <password>"
            exit 1
        fi
         
        DATABASE=$1
        PASSWORD=$2
         
        mysql -u root <<EOF
        CREATE DATABASE $DATABASE CHARACTER SET 'utf8mb4' COLLATE 'utf8mb4_general_ci';
        CREATE USER 'relution'@'localhost' IDENTIFIED BY '$PASSWORD';
        GRANT ALL PRIVILEGES ON $DATABASE.* TO 'relution'@'localhost' IDENTIFIED BY '$PASSWORD';
        CREATE USER 'relution'@'%' IDENTIFIED BY '$PASSWORD';
        GRANT ALL PRIVILEGES ON $DATABASE.* TO 'relution'@'%' IDENTIFIED BY '$PASSWORD';
        FLUSH PRIVILEGES;
        EOF
        

      • chmod +x create_database.sh
      • ./create_database.sh relution password

      Minimal application configuration

      • Create /opt/relution/application.yml =>

        relution:
          server:
            externalURL: https://www.example.org
          database:
            type: mysql
            url: jdbc:mariadb://127.0.0.1:3306/relution?useServerPrepStmts=true
            username: relution
            password: password
        

      Start application

      • sudo -u relution ./bin/relution-foreground.sh
      • Wait until database has been initialized
      • "INFO 10033 [ main] vice.StandardLockService: Successfully released change log lock"
      • Stop application (Ctrl+C)

      You can now start and stop the application, the database is working as expected.

      Restart MariaDB

      • systemctl stop mariadb.service
      • systemctl start mariadb.service

      Attempt to start application again

      • sudo -u relution ./bin/relution-foreground.sh
        ==> The database is now broken

      2019-12-05 11:37:36.146 ERROR 10335 [        main] s.boot.SpringApplication: Application run failed []
      java.sql.SQLException: Table 'relution.scheduler_task' doesn't exist in engine
      Query is: SELECT t0.`uuid`, t1.`scheduler_task_uuid`, t0.`active`, t0.`clustered`, t0.`data`, t0.`description`, t0.`last_success_date`, t0.`name`, t0.`run_as_user`, t0.`schedulable_type`, t0.`schedulable_uuid`, t0.`version`, t1.`expression`, t1.`period_number`, t1.`period_type`, t1.`start` FROM `scheduler_task` t0, `scheduler_task_period` t1 WHERE (t1.`scheduler_task_uuid` = t0.`uuid`)
      <…>
      Wrapped by: org.eclipse.persistence.exceptions.DatabaseException: 
      Internal Exception: java.sql.SQLSyntaxErrorException: (conn=18) Table 'relution.scheduler_task' doesn't exist in engine
      Error Code: 1932
      

      Attachments

        1. docker-compose.yml
          1 kB
        2. mariadb.log
          3 kB
        3. relution.cnf
          0.1 kB

        Issue Links

          Activity

            People

              thiru Thirunarayanan Balathandayuthapani
              m.pfeiffer Markus
              Votes:
              0 Vote for this issue
              Watchers:
              5 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.