[MDEV-22481] Server crash after access to table with imported tablespace (after restart) Created: 2020-05-06  Updated: 2020-06-04  Resolved: 2020-06-04

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - InnoDB
Affects Version/s: 10.4.12
Fix Version/s: 10.4.13

Type: Bug Priority: Major
Reporter: Marek Šrom Assignee: Marko Mäkelä
Resolution: Duplicate Votes: 0
Labels: None
Environment:

Cent OS 8


Attachments: File a1.cfg     File a1.frm     File a1.ibd    
Issue Links:
Duplicate
duplicates MDEV-21549 IMPORT TABLESPACE fails to adjust all... Closed
Relates
relates to MDEV-13542 Crashing on a corrupted page is unhel... Closed

 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]



 Comments   
Comment by Marko Mäkelä [ 2020-05-06 ]

This looks like a duplicate of MDEV-21549.

Comment by Marek Šrom [ 2020-05-06 ]

Sorry): I'd like to ask, if I understand there is a fix for import table space to avoid this... Shouldn't there be even some fix to avoid server crash in case of "corrupted" data file? I don't think server should crash in this case... I understand that database/table will be unaccessible but server crash? Thanks

Comment by Marek Šrom [ 2020-05-06 ]

And sorry for bothering, but is there some information about MariaDB 10.4.13 release date? Thanks (if it's worth building myself or not...)

Comment by Marko Mäkelä [ 2020-06-04 ]

MDEV-13542 has been filed for avoiding crashes on corrupted data.

Generated at Thu Feb 08 09:15:03 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.