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

Server crash after access to table with imported tablespace (after restart)

    XMLWordPrintable

Details

    Description

      I created script to detach / attach database, attached database works fine until restart...

      To reproduce:
      #create database + 1 table + 1 row

      CREATE DATABASE `db6` DEFAULT CHARACTER SET latin1 ;
      USE db6;
      CREATE TABLE `a1` (
      `a` int(11) DEFAULT NULL
      ) ENGINE=InnoDB DEFAULT CHARSET=latin1;

      insert into a1 value(1);

      #export data
      FLUSH TABLE a1 FOR EXPORT;

      #copy files db6/a1.frm, db6/a1.ibd, db6/a1.cfg somewhere else

      #unlock

      UNLOCK TABLES;

      #drop database

      DROP DATABASE db6;

      #restore database back
      CREATE DATABASE `db6` DEFAULT CHARACTER SET latin1 ;
      USE db6;
      CREATE TABLE `a1` (
      `a` int(11) DEFAULT NULL
      ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
      ALTER TABLE a1 DISCARD TABLESPACE;

      #copy saved files db6/a1.cfg, db6/a1.frm, db6/a1.ibd back

      #change owner to mysql:mysql if needed

      #import tablespace
      ALTER TABLE a1 IMPORT TABLESPACE;

      #test
      use db6;
      select * from a1;
      ------

      a

      ------

      1

      ------
      – OK

      #restart service
      service mariadb restart

      #test again
      use db6;

      select * from a1;

      ERROR 2006 (HY000): MySQL server has gone away

      Error log:
      2020-05-06 08:51:39 0x7f973811c700 InnoDB: Assertion failure in file /home/buildbot/buildbot/padding_for_CPACK_RPM_BUILD_SOURCE_DIRS_PREFIX/mariadb-10.4.12/storage/innobase/btr/btr0btr.cc line 204
      InnoDB: Failing assertion: mach_read_from_4(seg_header + FSEG_HDR_SPACE) == space
      InnoDB: We intentionally generate a memory trap.
      InnoDB: Submit a detailed bug report to https://jira.mariadb.org/
      InnoDB: If you get repeated assertion failures or crashes, even
      InnoDB: immediately after the mysqld startup, there may be
      InnoDB: corruption in the InnoDB tablespace. Please refer to
      InnoDB: https://mariadb.com/kb/en/library/innodb-recovery-modes/
      InnoDB: about forcing recovery.
      200506 8:51:39 [ERROR] mysqld got signal 6 ;
      This could be because you hit a bug. It is also possible that this binary
      or one of the libraries it was linked against is corrupt, improperly built,
      or misconfigured. This error can also be caused by malfunctioning hardware.

      To report this bug, see https://mariadb.com/kb/en/reporting-bugs

      We will try our best to scrape up some info that will hopefully help
      diagnose the problem, but since we have already crashed,
      something is definitely wrong and this may fail.

      Server version: 10.4.12-MariaDB
      key_buffer_size=134217728
      read_buffer_size=131072
      max_used_connections=1
      max_threads=153
      thread_count=7
      It is possible that mysqld could use up to
      key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 467756 K bytes of memory
      Hope that's ok; if not, decrease some variables in the equation.

      Thread pointer: 0x7f96d0000c08
      Attempting backtrace. You can use the following information to find out
      where mysqld died. If you see no messages after this, something went
      terribly wrong...
      stack_bottom = 0x7f973811bc98 thread_stack 0x49000
      /usr/sbin/mysqld(my_print_stacktrace+0x2e)[0x5611a6d18cae]
      /usr/sbin/mysqld(handle_fatal_signal+0x54d)[0x5611a681357d]
      /lib64/libpthread.so.0(+0x12dc0)[0x7f973cb4bdc0]
      /lib64/libc.so.6(gsignal+0x10f)[0x7f973ac108df]
      /lib64/libc.so.6(abort+0x127)[0x7f973abfacf5]
      /usr/sbin/mysqld(+0x5a3393)[0x5611a6505393]
      /usr/sbin/mysqld(+0x5a391f)[0x5611a650591f]
      /usr/sbin/mysqld(+0xb73fcd)[0x5611a6ad5fcd]
      /usr/sbin/mysqld(+0xb74081)[0x5611a6ad6081]
      /usr/sbin/mysqld(+0x5a6516)[0x5611a6508516]
      /usr/sbin/mysqld(+0x5b1c86)[0x5611a6513c86]
      /usr/sbin/mysqld(+0xbe6301)[0x5611a6b48301]
      /usr/sbin/mysqld(+0xbd97e3)[0x5611a6b3b7e3]
      /usr/sbin/mysqld(+0xa51246)[0x5611a69b3246]
      /usr/sbin/mysqld(_ZN7handler7ha_openEP5TABLEPKcijP11st_mem_rootP4ListI6StringE+0x4a)[0x5611a681935a]
      /usr/sbin/mysqld(_Z21open_table_from_shareP3THDP11TABLE_SHAREPK25st_mysql_const_lex_stringjjjP5TABLEbP4ListI6StringE+0x87a)[0x5611a66c76ca]
      /usr/sbin/mysqld(_Z10open_tableP3THDP10TABLE_LISTP18Open_table_context+0xb33)[0x5611a65a58b3]

      Attachments

        1. a1.cfg
          0.4 kB
        2. a1.frm
          0.4 kB
        3. a1.ibd
          96 kB

        Issue Links

          Activity

            People

              marko Marko Mäkelä
              marek.srom Marek Šrom
              Votes:
              0 Vote for this issue
              Watchers:
              2 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.