[MDEV-12165] Failing assertion: zip_size == fil_space_get_zip_size(space) Created: 2017-03-02  Updated: 2023-04-27

Status: Open
Project: MariaDB Server
Component/s: Replication, Storage Engine - InnoDB
Affects Version/s: 10.0, 10.1, 10.2, 10.3
Fix Version/s: 10.4

Type: Bug Priority: Major
Reporter: Elena Stepanova Assignee: Andrei Elkin
Resolution: Unresolved Votes: 0
Labels: None


 Description   

10.0 d04d835f64b39edf0310e0471a7ed261b5cb2a20

2017-03-03 00:10:06 7f06bafa1700  InnoDB: Assertion failure in thread 139666883483392 in file buf0buf.cc line 2635
InnoDB: Failing assertion: zip_size == fil_space_get_zip_size(space)

#5  0x00007f06bb237448 in __GI_abort () at abort.c:89
#6  0x00007f06b370cb2c in buf_page_get_gen (space=space@entry=8, zip_size=zip_size@entry=0, offset=offset@entry=3, rw_latch=rw_latch@entry=3, guess=guess@entry=0x0, mode=mode@entry=10, file=0x7f06b394a6a8 "/data/src/10.0/storage/innobase/include/btr0pcur.ic", line=518, mtr=0x7f06baf9e7a0) at /data/src/10.0/storage/innobase/buf/buf0buf.cc:2635
#7  0x00007f06b36e2bb7 in btr_cur_open_at_index_side_func (from_left=from_left@entry=true, index=index@entry=0x7f06a684dff8, latch_mode=latch_mode@entry=1, cursor=cursor@entry=0x7f06a64ba0f0, level=level@entry=0, file=file@entry=0x7f06b394a6a8 "/data/src/10.0/storage/innobase/include/btr0pcur.ic", line=518, mtr=0x7f06baf9e7a0) at /data/src/10.0/storage/innobase/btr/btr0cur.cc:897
#8  0x00007f06b38d77f1 in btr_pcur_open_at_index_side (mtr=0x7f06baf9e7a0, level=0, init_pcur=false, pcur=0x7f06a64ba0f0, latch_mode=1, index=0x7f06a684dff8, from_left=true) at /data/src/10.0/storage/innobase/include/btr0pcur.ic:518
#9  row_search_for_mysql (buf=buf@entry=0x7f06af2b6c88 "\377", mode=mode@entry=1, prebuilt=0x7f06a64ba078, match_mode=match_mode@entry=0, direction=direction@entry=0) at /data/src/10.0/storage/innobase/row/row0sel.cc:4175
#10 0x00007f06b37d2924 in ha_innodb::index_read (this=0x7f06a646f088, buf=0x7f06af2b6c88 "\377", key_ptr=0x0, key_len=<optimized out>, find_flag=<optimized out>) at /data/src/10.0/storage/innobase/handler/ha_innodb.cc:8177
#11 0x00007f06b37b94b0 in ha_innodb::index_first (this=0x7f06a646f088, buf=0x7f06af2b6c88 "\377") at /data/src/10.0/storage/innobase/handler/ha_innodb.cc:8585
#12 0x00007f06b37cc59a in ha_innodb::rnd_next (this=0x7f06a646f088, buf=0x7f06af2b6c88 "\377") at /data/src/10.0/storage/innobase/handler/ha_innodb.cc:8682
#13 0x000000000073d86c in handler::ha_rnd_next (this=0x7f06a646f088, buf=0x7f06af2b6c88 "\377") at /data/src/10.0/sql/handler.cc:2598
#14 0x0000000000840ce4 in rr_sequential (info=0x7f06a64cf130) at /data/src/10.0/sql/records.cc:469
#15 0x00000000005ea294 in join_init_read_record (tab=0x7f06a64cf088) at /data/src/10.0/sql/sql_select.cc:18764
#16 0x00000000005ea45c in sub_select (join=join@entry=0x7f06a6422960, join_tab=join_tab@entry=0x7f06a64cf088, end_of_records=end_of_records@entry=false) at /data/src/10.0/sql/sql_select.cc:17856
#17 0x00000000005fae26 in do_select (join=join@entry=0x7f06a6422960, fields=fields@entry=0x7f06af35b210, table=table@entry=0x0, procedure=0x0) at /data/src/10.0/sql/sql_select.cc:17521
#18 0x000000000060eb8a in JOIN::exec_inner (this=this@entry=0x7f06a6422960) at /data/src/10.0/sql/sql_select.cc:3089
#19 0x000000000060f2f5 in JOIN::exec (this=this@entry=0x7f06a6422960) at /data/src/10.0/sql/sql_select.cc:2378
#20 0x000000000060bd8c in mysql_select (thd=thd@entry=0x7f06af357070, rref_pointer_array=rref_pointer_array@entry=0x7f06af35b370, tables=0x7f06a64222b0, wild_num=1, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x7f06a6422940, unit=0x7f06af35aa08, select_lex=0x7f06af35b0f8) at /data/src/10.0/sql/sql_select.cc:3314
#21 0x000000000060bf78 in handle_select (thd=thd@entry=0x7f06af357070, lex=lex@entry=0x7f06af35a940, result=result@entry=0x7f06a6422940, setup_tables_done_option=setup_tables_done_option@entry=0) at /data/src/10.0/sql/sql_select.cc:373
#22 0x00000000005a9255 in execute_sqlcom_select (thd=thd@entry=0x7f06af357070, all_tables=0x7f06a64222b0) at /data/src/10.0/sql/sql_parse.cc:5301
#23 0x00000000005b0c55 in mysql_execute_command (thd=thd@entry=0x7f06af357070) at /data/src/10.0/sql/sql_parse.cc:2563
#24 0x00000000005b944d in mysql_parse (thd=thd@entry=0x7f06af357070, rawbuf=<optimized out>, length=34, parser_state=parser_state@entry=0x7f06bafa05f0) at /data/src/10.0/sql/sql_parse.cc:6583
#25 0x00000000005ba9b0 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x7f06af357070, packet=packet@entry=0x7f06af363071 "", packet_length=packet_length@entry=34) at /data/src/10.0/sql/sql_parse.cc:1309
#26 0x00000000005bc745 in do_command (thd=0x7f06af357070) at /data/src/10.0/sql/sql_parse.cc:999
#27 0x000000000069726e in do_handle_one_connection (thd_arg=thd_arg@entry=0x7f06af357070) at /data/src/10.0/sql/sql_connect.cc:1377
#28 0x000000000069734e in handle_one_connection (arg=arg@entry=0x7f06af357070) at /data/src/10.0/sql/sql_connect.cc:1292
#29 0x00000000008ba38b in pfs_spawn_thread (arg=0x7f06af2ec070) at /data/src/10.0/storage/perfschema/pfs.cc:1860
#30 0x00007f06bc8be0a4 in start_thread (arg=0x7f06bafa1700) at pthread_create.c:309
#31 0x00007f06bb2e987d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

The test case is only for reproducing, don't put it into the regression suite!

Test case

--source include/master-slave.inc
--source include/have_innodb.inc
 
--connection slave
STOP SLAVE;
ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
 
--delimiter $
CREATE PROCEDURE pr()
BEGIN
LOOP
  SET GLOBAL gtid_slave_pos = @@global.gtid_slave_pos;
END LOOP;
END $
--delimiter ;
 
--send CALL pr()
 
--connection slave1
 
--let $run=10000
while ($run)
{
   SELECT * FROM mysql.gtid_slave_pos;
   --dec $run
}

I cannot check the contents of the ibd file, because at some point it disappears. I'm not sure whether this disappearance is a result of the assertion failure, or that's what causes it.

Not reproducible (at least with this test case) on 10.2.



 Comments   
Comment by Marko Mäkelä [ 2017-08-10 ]

Elkin, could you repeat this this on 10.0 or 10.1, and ping me for help on analyzing?

Comment by Elena Stepanova [ 2018-06-26 ]

Still reproducible on 10.0 and 10.1.
I'm not sure how much it has to do with replication, I got the same assertion failure on current 10.1 while running a non-replication test (binlog was enabled though).

And now 10.2 and 10.3 also fail readily with the provided test case, but the assertion failure (also on slave) is different:

10.2 ee6ac4d313

mysqld: /data/src/10.2/storage/innobase/btr/btr0cur.cc:2191: dberr_t btr_cur_open_at_index_side_func(bool, dict_index_t*, ulint, btr_cur_t*, ulint, const char*, unsigned int, mtr_t*): Assertion `index->id == btr_page_get_index_id(page)' failed.
180626 23:05:39 [ERROR] mysqld got signal 6 ;
 
#7  0x00007f3a98f44ee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
#8  0x000055c454fd6e44 in btr_cur_open_at_index_side_func (from_left=true, index=0x7f3a34023138, latch_mode=1, cursor=0x7f3a28020a90, level=0, file=0x55c455542728 "/data/src/10.3/storage/innobase/include/btr0pcur.ic", line=539, mtr=0x7f3a8e083530) at /data/src/10.3/storage/innobase/btr/btr0cur.cc:2390
#9  0x000055c454eff58d in btr_pcur_open_at_index_side (from_left=true, index=0x7f3a34023138, latch_mode=1, pcur=0x7f3a28020a90, init_pcur=false, level=0, mtr=0x7f3a8e083530) at /data/src/10.3/storage/innobase/include/btr0pcur.ic:539
#10 0x000055c454f0ae65 in row_search_mvcc (buf=0x7f3a2801fff8 "\377", mode=PAGE_CUR_G, prebuilt=0x7f3a280208b8, match_mode=0, direction=0) at /data/src/10.3/storage/innobase/row/row0sel.cc:4652
#11 0x000055c454d7c55f in ha_innobase::index_read (this=0x7f3a2801f7f8, buf=0x7f3a2801fff8 "\377", key_ptr=0x0, key_len=0, find_flag=HA_READ_AFTER_KEY) at /data/src/10.3/storage/innobase/handler/ha_innodb.cc:9315
#12 0x000055c454d7d820 in ha_innobase::index_first (this=0x7f3a2801f7f8, buf=0x7f3a2801fff8 "\377") at /data/src/10.3/storage/innobase/handler/ha_innodb.cc:9732
#13 0x000055c454d7da2b in ha_innobase::rnd_next (this=0x7f3a2801f7f8, buf=0x7f3a2801fff8 "\377") at /data/src/10.3/storage/innobase/handler/ha_innodb.cc:9825
#14 0x000055c454a5bd37 in handler::ha_rnd_next (this=0x7f3a2801f7f8, buf=0x7f3a2801fff8 "\377") at /data/src/10.3/sql/handler.cc:2764
#15 0x000055c454bdcda5 in rr_sequential (info=0x7f3a28015bc8) at /data/src/10.3/sql/records.cc:481
#16 0x000055c4546d16d7 in READ_RECORD::read_record (this=0x7f3a28015bc8) at /data/src/10.3/sql/records.h:73
#17 0x000055c4547e05b6 in join_init_read_record (tab=0x7f3a28015b00) at /data/src/10.3/sql/sql_select.cc:20187
#18 0x000055c4547de27e in sub_select (join=0x7f3a28014410, join_tab=0x7f3a28015b00, end_of_records=false) at /data/src/10.3/sql/sql_select.cc:19252
#19 0x000055c4547dd81a in do_select (join=0x7f3a28014410, procedure=0x0) at /data/src/10.3/sql/sql_select.cc:18795
#20 0x000055c4547b67fb in JOIN::exec_inner (this=0x7f3a28014410) at /data/src/10.3/sql/sql_select.cc:4011
#21 0x000055c4547b5c6c in JOIN::exec (this=0x7f3a28014410) at /data/src/10.3/sql/sql_select.cc:3805
#22 0x000055c4547b6edc in mysql_select (thd=0x7f3a28000b00, tables=0x7f3a28013cd8, wild_num=1, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x7f3a280143f0, unit=0x7f3a28004978, select_lex=0x7f3a280050e8) at /data/src/10.3/sql/sql_select.cc:4210
#23 0x000055c4547a8fd6 in handle_select (thd=0x7f3a28000b00, lex=0x7f3a280048b0, result=0x7f3a280143f0, setup_tables_done_option=0) at /data/src/10.3/sql/sql_select.cc:382
#24 0x000055c4547739f1 in execute_sqlcom_select (thd=0x7f3a28000b00, all_tables=0x7f3a28013cd8) at /data/src/10.3/sql/sql_parse.cc:6541
#25 0x000055c45476a11b in mysql_execute_command (thd=0x7f3a28000b00) at /data/src/10.3/sql/sql_parse.cc:3764
#26 0x000055c454777935 in mysql_parse (thd=0x7f3a28000b00, rawbuf=0x7f3a28013aa8 "SELECT * FROM mysql.gtid_slave_pos", length=34, parser_state=0x7f3a8e0855f0, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:8076
#27 0x000055c454764c08 in dispatch_command (command=COM_QUERY, thd=0x7f3a28000b00, packet=0x7f3a2800b2e1 "", packet_length=34, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:1847
#28 0x000055c45476362c in do_command (thd=0x7f3a28000b00) at /data/src/10.3/sql/sql_parse.cc:1392
#29 0x000055c4548c8ddb in do_handle_one_connection (connect=0x55c458481f30) at /data/src/10.3/sql/sql_connect.cc:1402
#30 0x000055c4548c8b5f in handle_one_connection (arg=0x55c458481f30) at /data/src/10.3/sql/sql_connect.cc:1308
#31 0x000055c454d58d1f in pfs_spawn_thread (arg=0x55c45803d120) at /data/src/10.3/storage/perfschema/pfs.cc:1862
#32 0x00007f3a9ac1b494 in start_thread (arg=0x7f3a8e086700) at pthread_create.c:333
#33 0x00007f3a9900193f in clone () from /lib/x86_64-linux-gnu/libc.so.6

Generated at Thu Feb 08 07:55:37 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.