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

Assertion `!"wrong page type"' or Assertion `"wrong page type" == 0' failed in innobase_instant_try on ALTER

Details

    Description

      Upd: See Roel's comment for a test case.

      10.4 4edb29380c9

      mysqld: /home/travis/src/storage/innobase/handler/handler0alter.cc:5690: bool innobase_instant_try(const Alter_inplace_info*, ha_innobase_inplace_ctx*, const TABLE*, const TABLE*, trx_t*): Assertion `!"wrong page type"' failed.
      190120 22:00:51 [ERROR] mysqld got signal 6 ;
       
      /lib/x86_64-linux-gnu/libc.so.6(+0x2dc82)[0x7fd67eaf1c82]
      /home/travis/server/bin/mysqld(+0x1d5d7d4)[0x55c8a1f2e7d4]
      handler/handler0alter.cc:5695(innobase_instant_try(Alter_inplace_info const*, ha_innobase_inplace_ctx*, TABLE const*, TABLE const*, trx_t*))[0x55c8a1f6e80b]
      handler/handler0alter.cc:10160(commit_try_norebuild(Alter_inplace_info*, ha_innobase_inplace_ctx*, TABLE*, TABLE const*, trx_t*, char const*))[0x55c8a1f4e097]
      handler/handler0alter.cc:10793(ha_innobase::commit_inplace_alter_table(TABLE*, Alter_inplace_info*, bool))[0x55c8a19c864e]
      sql/handler.cc:4493(handler::ha_commit_inplace_alter_table(TABLE*, Alter_inplace_info*, bool))[0x55c8a14b3fb4]
      sql/sql_table.cc:7590(mysql_inplace_alter_table(THD*, TABLE_LIST*, TABLE*, TABLE*, Alter_inplace_info*, enum_alter_inplace_result, MDL_request*, Alter_table_ctx*))[0x55c8a14c085e]
      sql/sql_table.cc:9688(mysql_alter_table(THD*, st_mysql_const_lex_string const*, st_mysql_const_lex_string const*, HA_CREATE_INFO*, TABLE_LIST*, Alter_info*, unsigned int, st_order*, bool))[0x55c8a16015ea]
      sql/sql_alter.cc:497(Sql_cmd_alter_table::execute(THD*))[0x55c8a12b8346]
      sql/sql_parse.cc:6314(mysql_execute_command(THD*))[0x55c8a12c2b9a]
      sql/sql_parse.cc:8116(mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool))[0x55c8a129d915]
      sql/sql_parse.cc:1854(dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool))[0x55c8a129aaad]
      sql/sql_parse.cc:1397(do_command(THD*))[0x55c8a15f272f]
      sql/sql_connect.cc:1402(do_handle_one_connection(CONNECT*))[0x55c8a15f210c]
      /lib/x86_64-linux-gnu/libpthread.so.0(+0x76ba)[0x7fd67f7366ba]
      /lib/x86_64-linux-gnu/libc.so.6(clone+0x6d)[0x7fd67ebcb41d]
      Trying to get some variables.
      Some pointers may be invalid and cause the dump to abort.
      Query (0x62b00015e288): ALTER ONLINE TABLE `t014` /*!100301 */ DROP COLUMN IF EXISTS `col_int_nokey`, ALGORITHM=INPLACE  /* QNO 5151 CON_ID 19 */
      Connection ID (thread ID): 19
      Status: NOT_KILLED
      Optimizer switch: index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on
      

      elenst-jira-refs 19e81706f Toolbox: dbef832b2

      perl ./runall-new.pl --basedir=/home/travis/server --vardir=/home/travis/logs/vardir --duration=350 --threads=6 --seed=1548021243 --short-column-names --reporters=Backtrace,ErrorLog,Deadlock --validators=TransformerNoComparator --transformers=ExecuteAsExecuteImmediate,ExecuteAsInsertSelect,ExecuteAsUpdateDelete --redefine=conf/mariadb/alter_table.yy --redefine=conf/mariadb/instant_add.yy --redefine=conf/mariadb/modules/alter_table_columns.yy --redefine=conf/mariadb/modules/alter_table_indexes.yy --redefine=conf/mariadb/bulk_insert.yy --redefine=conf/mariadb/modules/admin.yy --redefine=conf/mariadb/modules/foreign_keys.yy -redefine=conf/mariadb/modules/locks.yy --redefine=conf/mariadb/modules/sql_mode.yy --redefine=conf/mariadb/redefine_temporary_tables.yy --redefine=conf/mariadb/versioning.yy --redefine=conf/mariadb/sequences.yy --mysqld=--log_output=FILE --mysqld=--max-statement-time=15 --mysqld=--lock-wait-timeout=10 --mysqld=--loose-innodb-lock-wait-timeout=5 --mysqld=--loose-debug_assert_on_not_freed_memory=0 --mysqld=--innodb-buffer-pool-size=2G --grammar=conf/partitioning/partitions.yy --gendata=conf/mariadb/innodb.zz --filter=/home/travis/mariadb-toolbox/travis/10.4-combo-filter-asan.ff --mysqld=--innodb-page-size=8K
      

      Not reproducible so far, hitting MDEV-18321 instead.

      Attachments

        Issue Links

          Activity

            elenst Elena Stepanova added a comment - New occurrence: https://dev.azure.com/elenst/MariaDB%20tests/_build/results?buildId=126
            elenst Elena Stepanova added a comment - New occurrence: https://travis-ci.org/elenst/travis-tests/jobs/490549952 [2704 32 2]
            elenst Elena Stepanova added a comment - New occurrence: https://travis-ci.org/elenst/travis-tests/jobs/520788312 [3225 27 2]
            elenst Elena Stepanova added a comment - New occurrence: https://travis-ci.org/elenst/travis-tests/jobs/537822309 [3479 27 2]

            CREATE TABLE t (c1 CHAR(200),c02 CHAR(200),c03 CHAR(200),c04 CHAR(200),c05 CHAR(200),c06 CHAR(200),c07 CHAR(200),c08 CHAR(200),c09 CHAR(200),c10 CHAR(200),c11 CHAR(200),c12 CHAR(200),c13 CHAR(200),c14 CHAR(200),c15 CHAR(200),c16 CHAR(200),c17 CHAR(200),c18 CHAR(200),c19 CHAR(200),c20 CHAR(200),c21 CHAR(200),c22 CHAR(200),c23 CHAR(200),c24 CHAR(200),c25 CHAR(200),c26 CHAR(200),c27 CHAR(200),c28 CHAR(200),c29 CHAR(200),c30 CHAR(200),c31 CHAR(200),c32 CHAR(200),c33 CHAR(200),c34 CHAR(200),c35 CHAR(200),c36 CHAR(200),c37 CHAR(200),c38 CHAR(200),c39 CHAR(200),c40 CHAR(211)) ENGINE=InnoDB ROW_FORMAT=redundant;
            ALTER TABLE t ADD c2 INT FIRST;
            ALTER TABLE t ADD c3 INT FIRST;
            

            Leads to:

            11.1.0 2b61ff8f2221745f0a96855a0feb0825c426f993 (Debug)

            mariadbd: /test/11.1_dbg/storage/innobase/handler/handler0alter.cc:6223: bool innobase_instant_try(const Alter_inplace_info*, ha_innobase_inplace_ctx*, const TABLE*, const TABLE*, trx_t*): Assertion `"wrong page type" == 0' failed.
            

            11.1.0 2b61ff8f2221745f0a96855a0feb0825c426f993 (Debug)

            Core was generated by `/test/MD070423-mariadb-11.1.0-linux-x86_64-dbg/bin/mariadbd --no-defaults --cor'.
            Program terminated with signal SIGABRT, Aborted.
            #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=22828829197888)
                at ./nptl/pthread_kill.c:44
            [Current thread is 1 (Thread 0x14c340414640 (LWP 404650))]
            (gdb) bt
            #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=22828829197888) at ./nptl/pthread_kill.c:44
            #1  __pthread_kill_internal (signo=6, threadid=22828829197888) at ./nptl/pthread_kill.c:78
            #2  __GI___pthread_kill (threadid=22828829197888, signo=signo@entry=6) at ./nptl/pthread_kill.c:89
            #3  0x000014c35db75476 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
            #4  0x000014c35db5b7f3 in __GI_abort () at ./stdlib/abort.c:79
            #5  0x000014c35db5b71b in __assert_fail_base (fmt=0x14c35dd10150 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x55ad481ae9d9 "\"wrong page type\" == 0", file=0x55ad481a6e90 "/test/11.1_dbg/storage/innobase/handler/handler0alter.cc", line=6223, function=<optimized out>) at ./assert/assert.c:92
            #6  0x000014c35db6ce96 in __GI___assert_fail (assertion=0x55ad481ae9d9 "\"wrong page type\" == 0", file=0x55ad481a6e90 "/test/11.1_dbg/storage/innobase/handler/handler0alter.cc", line=6223, function=0x55ad481aea78 "bool innobase_instant_try(const Alter_inplace_info*, ha_innobase_inplace_ctx*, const TABLE*, const TABLE*, trx_t*)") at ./assert/assert.c:101
            #7  0x000055ad47a8133e in innobase_instant_try (ha_alter_info=ha_alter_info@entry=0x14c34040fd90, ctx=ctx@entry=0x14c2f8024330, altered_table=altered_table@entry=0x14c34040fe50, table=table@entry=0x14c2f801f188, trx=trx@entry=0x14c354e2e680) at /test/11.1_dbg/storage/innobase/handler/handler0alter.cc:6223
            #8  0x000055ad47a82f12 in commit_try_norebuild (ha_alter_info=ha_alter_info@entry=0x14c34040fd90, ctx=ctx@entry=0x14c2f8024330, altered_table=altered_table@entry=0x14c34040fe50, old_table=0x14c2f801f188, trx=trx@entry=0x14c354e2e680, table_name=<optimized out>) at /test/11.1_dbg/storage/innobase/handler/handler0alter.cc:10621
            #9  0x000055ad47a6e4a3 in ha_innobase::commit_inplace_alter_table (this=<optimized out>, altered_table=<optimized out>, ha_alter_info=<optimized out>, commit=<optimized out>) at /test/11.1_dbg/storage/innobase/handler/handler0alter.cc:11384
            #10 0x000055ad4775c617 in handler::ha_commit_inplace_alter_table (this=0x14c2f8053d80, altered_table=altered_table@entry=0x14c34040fe50, ha_alter_info=ha_alter_info@entry=0x14c34040fd90, commit=commit@entry=true) at /test/11.1_dbg/sql/handler.cc:5428
            #11 0x000055ad475549fa in mysql_inplace_alter_table (thd=thd@entry=0x14c2f8000d58, table_list=0x14c2f8013260, table=table@entry=0x14c2f801f188, altered_table=altered_table@entry=0x14c34040fe50, ha_alter_info=ha_alter_info@entry=0x14c34040fd90, target_mdl_request=target_mdl_request@entry=0x14c340410630, ddl_log_state=0x14c34040fd20, trigger_param=0x14c340410210, alter_ctx=0x14c340411510, partial_alter=@0x14c34040fc8f: false, start_alter_id=@0x14c34040fc98: 0, if_exists=false) at /test/11.1_dbg/sql/sql_table.cc:7810
            #12 0x000055ad47566b6d in mysql_alter_table (thd=thd@entry=0x14c2f8000d58, new_db=new_db@entry=0x14c2f8005878, new_name=new_name@entry=0x14c2f8005cc8, create_info=create_info@entry=0x14c340412320, table_list=<optimized out>, table_list@entry=0x14c2f8013260, recreate_info=recreate_info@entry=0x14c340412210, alter_info=<optimized out>, order_num=<optimized out>, order=<optimized out>, ignore=<optimized out>, if_exists=<optimized out>) at /test/11.1_dbg/sql/sql_table.cc:10846
            #13 0x000055ad475e6d2c in Sql_cmd_alter_table::execute (this=<optimized out>, thd=0x14c2f8000d58) at /test/11.1_dbg/sql/sql_alter.cc:558
            #14 0x000055ad47488604 in mysql_execute_command (thd=thd@entry=0x14c2f8000d58, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /test/11.1_dbg/sql/sql_parse.cc:5760
            #15 0x000055ad47489f05 in mysql_parse (thd=thd@entry=0x14c2f8000d58, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14c340413230) at /test/11.1_dbg/sql/sql_parse.cc:7760
            #16 0x000055ad4748c099 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14c2f8000d58, packet=packet@entry=0x14c2f800ae49 "ALTER TABLE t ADD c3 INT FIRST", packet_length=packet_length@entry=30, blocking=blocking@entry=true) at /test/11.1_dbg/sql/sql_class.h:242
            #17 0x000055ad4748def5 in do_command (thd=0x14c2f8000d58, blocking=blocking@entry=true) at /test/11.1_dbg/sql/sql_parse.cc:1405
            #18 0x000055ad475dfcfc in do_handle_one_connection (connect=<optimized out>, connect@entry=0x55ad4b452698, put_in_cache=put_in_cache@entry=true) at /test/11.1_dbg/sql/sql_connect.cc:1416
            #19 0x000055ad475dff5b in handle_one_connection (arg=0x55ad4b452698) at /test/11.1_dbg/sql/sql_connect.cc:1318
            #20 0x000014c35dbc7b43 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
            #21 0x000014c35dc59a00 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
            

            10.4.29 ed2adc8c6f986f7e9c81d7a99f85cad0e2d46d80 (Debug)

            mariadbd: /test/10.4_dbg/storage/innobase/handler/handler0alter.cc:6123: bool innobase_instant_try(const Alter_inplace_info*, ha_innobase_inplace_ctx*, const TABLE*, const TABLE*, trx_t*): Assertion `!"wrong page type"' failed.
            

            10.4.29 ed2adc8c6f986f7e9c81d7a99f85cad0e2d46d80 (Debug)

            Core was generated by `/test/MD070423-mariadb-10.4.29-linux-x86_64-dbg/bin/mariadbd --no-defaults --co'.
            Program terminated with signal SIGABRT, Aborted.
            #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=23352279307840)
                at ./nptl/pthread_kill.c:44
            [Current thread is 1 (Thread 0x153d20501640 (LWP 405093))]
            (gdb) bt
            #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=23352279307840) at ./nptl/pthread_kill.c:44
            #1  __pthread_kill_internal (signo=6, threadid=23352279307840) at ./nptl/pthread_kill.c:78
            #2  __GI___pthread_kill (threadid=23352279307840, signo=signo@entry=6) at ./nptl/pthread_kill.c:89
            #3  0x0000153d3b0b8476 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
            #4  0x0000153d3b09e7f3 in __GI_abort () at ./stdlib/abort.c:79
            #5  0x0000153d3b09e71b in __assert_fail_base (fmt=0x153d3b253150 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x562b154c4bee "!\"wrong page type\"", file=0x562b154bbb30 "/test/10.4_dbg/storage/innobase/handler/handler0alter.cc", line=6123, function=<optimized out>) at ./assert/assert.c:92
            #6  0x0000153d3b0afe96 in __GI___assert_fail (assertion=0x562b154c4bee "!\"wrong page type\"", file=0x562b154bbb30 "/test/10.4_dbg/storage/innobase/handler/handler0alter.cc", line=6123, function=0x562b154c4458 "bool innobase_instant_try(const Alter_inplace_info*, ha_innobase_inplace_ctx*, const TABLE*, const TABLE*, trx_t*)") at ./assert/assert.c:101
            #7  0x0000562b14d584a9 in innobase_instant_try (ha_alter_info=ha_alter_info@entry=0x153d204fbb90, ctx=ctx@entry=0x153cdc03b7c8, altered_table=altered_table@entry=0x153d204fbc30, table=table@entry=0x153cdc028fc8, trx=trx@entry=0x153d38ef9208) at /test/10.4_dbg/storage/innobase/handler/handler0alter.cc:6123
            #8  0x0000562b14d59edd in commit_try_norebuild (ha_alter_info=ha_alter_info@entry=0x153d204fbb90, ctx=ctx@entry=0x153cdc03b7c8, altered_table=altered_table@entry=0x153d204fbc30, old_table=0x153cdc028fc8, trx=trx@entry=0x153d38ef9208, table_name=<optimized out>) at /test/10.4_dbg/storage/innobase/handler/handler0alter.cc:10499
            #9  0x0000562b14d434a5 in ha_innobase::commit_inplace_alter_table (this=0x153cdc02aac0, altered_table=0x153d204fbc30, ha_alter_info=0x153d204fbb90, commit=true) at /test/10.4_dbg/storage/innobase/handler/handler0alter.cc:11301
            #10 0x0000562b14a0d115 in handler::ha_commit_inplace_alter_table (this=0x153cdc02aac0, altered_table=altered_table@entry=0x153d204fbc30, ha_alter_info=ha_alter_info@entry=0x153d204fbb90, commit=commit@entry=true) at /test/10.4_dbg/sql/handler.cc:4678
            #11 0x0000562b1484f9ab in mysql_inplace_alter_table (thd=thd@entry=0x153cdc000d38, table_list=0x153cdc0125a0, table=table@entry=0x153cdc028fc8, altered_table=altered_table@entry=0x153d204fbc30, ha_alter_info=ha_alter_info@entry=0x153d204fbb90, target_mdl_request=target_mdl_request@entry=0x153d204fca20, alter_ctx=0x153d204fd560) at /test/10.4_dbg/sql/sql_table.cc:7915
            #12 0x0000562b1485ca74 in mysql_alter_table (thd=thd@entry=0x153cdc000d38, new_db=new_db@entry=0x153cdc0053a8, new_name=new_name@entry=0x153cdc005800, create_info=create_info@entry=0x153d204fe140, table_list=<optimized out>, table_list@entry=0x153cdc0125a0, recreate_info=recreate_info@entry=0x153d204fe060, alter_info=0x153d204fe080, order_num=0, order=0x0, ignore=false) at /test/10.4_dbg/sql/sql_table.cc:10388
            #13 0x0000562b148c6838 in Sql_cmd_alter_table::execute (this=0x153cdc012db8, thd=0x153cdc000d38) at /test/10.4_dbg/sql/sql_alter.cc:531
            #14 0x0000562b147a680d in mysql_execute_command (thd=thd@entry=0x153cdc000d38) at /test/10.4_dbg/sql/sql_parse.cc:6206
            #15 0x0000562b147a89d9 in mysql_parse (thd=thd@entry=0x153cdc000d38, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x153d20500350, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.4_dbg/sql/sql_parse.cc:7998
            #16 0x0000562b147aac2c in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x153cdc000d38, packet=packet@entry=0x153cdc019509 "ALTER TABLE t ADD c3 INT FIRST", packet_length=packet_length@entry=30, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.4_dbg/sql/sql_class.h:227
            #17 0x0000562b147acf89 in do_command (thd=0x153cdc000d38) at /test/10.4_dbg/sql/sql_parse.cc:1378
            #18 0x0000562b148c0e9c in do_handle_one_connection (connect=<optimized out>) at /test/10.4_dbg/sql/sql_connect.cc:1420
            #19 0x0000562b148c0f65 in handle_one_connection (arg=<optimized out>) at /test/10.4_dbg/sql/sql_connect.cc:1324
            #20 0x0000153d3b10ab43 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
            #21 0x0000153d3b19ca00 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
            

            Bug confirmed present in:
            MariaDB: 10.4.29 (dbg), 10.5.20 (dbg), 10.6.13 (dbg), 10.7.8 (dbg), 10.8.8 (dbg), 10.9.6 (dbg), 10.10.4 (dbg), 10.11.3 (dbg), 11.0.2 (dbg), 11.1.0 (dbg)

            Bug (or feature/syntax) confirmed not present in:
            MariaDB: 10.4.29 (opt), 10.5.20 (opt), 10.6.13 (opt), 10.7.8 (opt), 10.8.8 (opt), 10.9.6 (opt), 10.10.4 (opt), 10.11.3 (opt), 11.0.2 (opt), 11.1.0 (opt)
            MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.51 (dbg), 5.6.51 (opt), 5.7.40 (dbg), 5.7.40 (opt), 8.0.31 (dbg), 8.0.31 (opt)

            Roel Roel Van de Paar added a comment - CREATE TABLE t (c1 CHAR (200),c02 CHAR (200),c03 CHAR (200),c04 CHAR (200),c05 CHAR (200),c06 CHAR (200),c07 CHAR (200),c08 CHAR (200),c09 CHAR (200),c10 CHAR (200),c11 CHAR (200),c12 CHAR (200),c13 CHAR (200),c14 CHAR (200),c15 CHAR (200),c16 CHAR (200),c17 CHAR (200),c18 CHAR (200),c19 CHAR (200),c20 CHAR (200),c21 CHAR (200),c22 CHAR (200),c23 CHAR (200),c24 CHAR (200),c25 CHAR (200),c26 CHAR (200),c27 CHAR (200),c28 CHAR (200),c29 CHAR (200),c30 CHAR (200),c31 CHAR (200),c32 CHAR (200),c33 CHAR (200),c34 CHAR (200),c35 CHAR (200),c36 CHAR (200),c37 CHAR (200),c38 CHAR (200),c39 CHAR (200),c40 CHAR (211)) ENGINE=InnoDB ROW_FORMAT=redundant; ALTER TABLE t ADD c2 INT FIRST ; ALTER TABLE t ADD c3 INT FIRST ; Leads to: 11.1.0 2b61ff8f2221745f0a96855a0feb0825c426f993 (Debug) mariadbd: /test/11.1_dbg/storage/innobase/handler/handler0alter.cc:6223: bool innobase_instant_try(const Alter_inplace_info*, ha_innobase_inplace_ctx*, const TABLE*, const TABLE*, trx_t*): Assertion `"wrong page type" == 0' failed. 11.1.0 2b61ff8f2221745f0a96855a0feb0825c426f993 (Debug) Core was generated by `/test/MD070423-mariadb-11.1.0-linux-x86_64-dbg/bin/mariadbd --no-defaults --cor'. Program terminated with signal SIGABRT, Aborted. #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=22828829197888) at ./nptl/pthread_kill.c:44 [Current thread is 1 (Thread 0x14c340414640 (LWP 404650))] (gdb) bt #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=22828829197888) at ./nptl/pthread_kill.c:44 #1 __pthread_kill_internal (signo=6, threadid=22828829197888) at ./nptl/pthread_kill.c:78 #2 __GI___pthread_kill (threadid=22828829197888, signo=signo@entry=6) at ./nptl/pthread_kill.c:89 #3 0x000014c35db75476 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26 #4 0x000014c35db5b7f3 in __GI_abort () at ./stdlib/abort.c:79 #5 0x000014c35db5b71b in __assert_fail_base (fmt=0x14c35dd10150 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x55ad481ae9d9 "\"wrong page type\" == 0", file=0x55ad481a6e90 "/test/11.1_dbg/storage/innobase/handler/handler0alter.cc", line=6223, function=<optimized out>) at ./assert/assert.c:92 #6 0x000014c35db6ce96 in __GI___assert_fail (assertion=0x55ad481ae9d9 "\"wrong page type\" == 0", file=0x55ad481a6e90 "/test/11.1_dbg/storage/innobase/handler/handler0alter.cc", line=6223, function=0x55ad481aea78 "bool innobase_instant_try(const Alter_inplace_info*, ha_innobase_inplace_ctx*, const TABLE*, const TABLE*, trx_t*)") at ./assert/assert.c:101 #7 0x000055ad47a8133e in innobase_instant_try (ha_alter_info=ha_alter_info@entry=0x14c34040fd90, ctx=ctx@entry=0x14c2f8024330, altered_table=altered_table@entry=0x14c34040fe50, table=table@entry=0x14c2f801f188, trx=trx@entry=0x14c354e2e680) at /test/11.1_dbg/storage/innobase/handler/handler0alter.cc:6223 #8 0x000055ad47a82f12 in commit_try_norebuild (ha_alter_info=ha_alter_info@entry=0x14c34040fd90, ctx=ctx@entry=0x14c2f8024330, altered_table=altered_table@entry=0x14c34040fe50, old_table=0x14c2f801f188, trx=trx@entry=0x14c354e2e680, table_name=<optimized out>) at /test/11.1_dbg/storage/innobase/handler/handler0alter.cc:10621 #9 0x000055ad47a6e4a3 in ha_innobase::commit_inplace_alter_table (this=<optimized out>, altered_table=<optimized out>, ha_alter_info=<optimized out>, commit=<optimized out>) at /test/11.1_dbg/storage/innobase/handler/handler0alter.cc:11384 #10 0x000055ad4775c617 in handler::ha_commit_inplace_alter_table (this=0x14c2f8053d80, altered_table=altered_table@entry=0x14c34040fe50, ha_alter_info=ha_alter_info@entry=0x14c34040fd90, commit=commit@entry=true) at /test/11.1_dbg/sql/handler.cc:5428 #11 0x000055ad475549fa in mysql_inplace_alter_table (thd=thd@entry=0x14c2f8000d58, table_list=0x14c2f8013260, table=table@entry=0x14c2f801f188, altered_table=altered_table@entry=0x14c34040fe50, ha_alter_info=ha_alter_info@entry=0x14c34040fd90, target_mdl_request=target_mdl_request@entry=0x14c340410630, ddl_log_state=0x14c34040fd20, trigger_param=0x14c340410210, alter_ctx=0x14c340411510, partial_alter=@0x14c34040fc8f: false, start_alter_id=@0x14c34040fc98: 0, if_exists=false) at /test/11.1_dbg/sql/sql_table.cc:7810 #12 0x000055ad47566b6d in mysql_alter_table (thd=thd@entry=0x14c2f8000d58, new_db=new_db@entry=0x14c2f8005878, new_name=new_name@entry=0x14c2f8005cc8, create_info=create_info@entry=0x14c340412320, table_list=<optimized out>, table_list@entry=0x14c2f8013260, recreate_info=recreate_info@entry=0x14c340412210, alter_info=<optimized out>, order_num=<optimized out>, order=<optimized out>, ignore=<optimized out>, if_exists=<optimized out>) at /test/11.1_dbg/sql/sql_table.cc:10846 #13 0x000055ad475e6d2c in Sql_cmd_alter_table::execute (this=<optimized out>, thd=0x14c2f8000d58) at /test/11.1_dbg/sql/sql_alter.cc:558 #14 0x000055ad47488604 in mysql_execute_command (thd=thd@entry=0x14c2f8000d58, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /test/11.1_dbg/sql/sql_parse.cc:5760 #15 0x000055ad47489f05 in mysql_parse (thd=thd@entry=0x14c2f8000d58, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14c340413230) at /test/11.1_dbg/sql/sql_parse.cc:7760 #16 0x000055ad4748c099 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14c2f8000d58, packet=packet@entry=0x14c2f800ae49 "ALTER TABLE t ADD c3 INT FIRST", packet_length=packet_length@entry=30, blocking=blocking@entry=true) at /test/11.1_dbg/sql/sql_class.h:242 #17 0x000055ad4748def5 in do_command (thd=0x14c2f8000d58, blocking=blocking@entry=true) at /test/11.1_dbg/sql/sql_parse.cc:1405 #18 0x000055ad475dfcfc in do_handle_one_connection (connect=<optimized out>, connect@entry=0x55ad4b452698, put_in_cache=put_in_cache@entry=true) at /test/11.1_dbg/sql/sql_connect.cc:1416 #19 0x000055ad475dff5b in handle_one_connection (arg=0x55ad4b452698) at /test/11.1_dbg/sql/sql_connect.cc:1318 #20 0x000014c35dbc7b43 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442 #21 0x000014c35dc59a00 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81 10.4.29 ed2adc8c6f986f7e9c81d7a99f85cad0e2d46d80 (Debug) mariadbd: /test/10.4_dbg/storage/innobase/handler/handler0alter.cc:6123: bool innobase_instant_try(const Alter_inplace_info*, ha_innobase_inplace_ctx*, const TABLE*, const TABLE*, trx_t*): Assertion `!"wrong page type"' failed. 10.4.29 ed2adc8c6f986f7e9c81d7a99f85cad0e2d46d80 (Debug) Core was generated by `/test/MD070423-mariadb-10.4.29-linux-x86_64-dbg/bin/mariadbd --no-defaults --co'. Program terminated with signal SIGABRT, Aborted. #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=23352279307840) at ./nptl/pthread_kill.c:44 [Current thread is 1 (Thread 0x153d20501640 (LWP 405093))] (gdb) bt #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=23352279307840) at ./nptl/pthread_kill.c:44 #1 __pthread_kill_internal (signo=6, threadid=23352279307840) at ./nptl/pthread_kill.c:78 #2 __GI___pthread_kill (threadid=23352279307840, signo=signo@entry=6) at ./nptl/pthread_kill.c:89 #3 0x0000153d3b0b8476 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26 #4 0x0000153d3b09e7f3 in __GI_abort () at ./stdlib/abort.c:79 #5 0x0000153d3b09e71b in __assert_fail_base (fmt=0x153d3b253150 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x562b154c4bee "!\"wrong page type\"", file=0x562b154bbb30 "/test/10.4_dbg/storage/innobase/handler/handler0alter.cc", line=6123, function=<optimized out>) at ./assert/assert.c:92 #6 0x0000153d3b0afe96 in __GI___assert_fail (assertion=0x562b154c4bee "!\"wrong page type\"", file=0x562b154bbb30 "/test/10.4_dbg/storage/innobase/handler/handler0alter.cc", line=6123, function=0x562b154c4458 "bool innobase_instant_try(const Alter_inplace_info*, ha_innobase_inplace_ctx*, const TABLE*, const TABLE*, trx_t*)") at ./assert/assert.c:101 #7 0x0000562b14d584a9 in innobase_instant_try (ha_alter_info=ha_alter_info@entry=0x153d204fbb90, ctx=ctx@entry=0x153cdc03b7c8, altered_table=altered_table@entry=0x153d204fbc30, table=table@entry=0x153cdc028fc8, trx=trx@entry=0x153d38ef9208) at /test/10.4_dbg/storage/innobase/handler/handler0alter.cc:6123 #8 0x0000562b14d59edd in commit_try_norebuild (ha_alter_info=ha_alter_info@entry=0x153d204fbb90, ctx=ctx@entry=0x153cdc03b7c8, altered_table=altered_table@entry=0x153d204fbc30, old_table=0x153cdc028fc8, trx=trx@entry=0x153d38ef9208, table_name=<optimized out>) at /test/10.4_dbg/storage/innobase/handler/handler0alter.cc:10499 #9 0x0000562b14d434a5 in ha_innobase::commit_inplace_alter_table (this=0x153cdc02aac0, altered_table=0x153d204fbc30, ha_alter_info=0x153d204fbb90, commit=true) at /test/10.4_dbg/storage/innobase/handler/handler0alter.cc:11301 #10 0x0000562b14a0d115 in handler::ha_commit_inplace_alter_table (this=0x153cdc02aac0, altered_table=altered_table@entry=0x153d204fbc30, ha_alter_info=ha_alter_info@entry=0x153d204fbb90, commit=commit@entry=true) at /test/10.4_dbg/sql/handler.cc:4678 #11 0x0000562b1484f9ab in mysql_inplace_alter_table (thd=thd@entry=0x153cdc000d38, table_list=0x153cdc0125a0, table=table@entry=0x153cdc028fc8, altered_table=altered_table@entry=0x153d204fbc30, ha_alter_info=ha_alter_info@entry=0x153d204fbb90, target_mdl_request=target_mdl_request@entry=0x153d204fca20, alter_ctx=0x153d204fd560) at /test/10.4_dbg/sql/sql_table.cc:7915 #12 0x0000562b1485ca74 in mysql_alter_table (thd=thd@entry=0x153cdc000d38, new_db=new_db@entry=0x153cdc0053a8, new_name=new_name@entry=0x153cdc005800, create_info=create_info@entry=0x153d204fe140, table_list=<optimized out>, table_list@entry=0x153cdc0125a0, recreate_info=recreate_info@entry=0x153d204fe060, alter_info=0x153d204fe080, order_num=0, order=0x0, ignore=false) at /test/10.4_dbg/sql/sql_table.cc:10388 #13 0x0000562b148c6838 in Sql_cmd_alter_table::execute (this=0x153cdc012db8, thd=0x153cdc000d38) at /test/10.4_dbg/sql/sql_alter.cc:531 #14 0x0000562b147a680d in mysql_execute_command (thd=thd@entry=0x153cdc000d38) at /test/10.4_dbg/sql/sql_parse.cc:6206 #15 0x0000562b147a89d9 in mysql_parse (thd=thd@entry=0x153cdc000d38, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x153d20500350, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.4_dbg/sql/sql_parse.cc:7998 #16 0x0000562b147aac2c in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x153cdc000d38, packet=packet@entry=0x153cdc019509 "ALTER TABLE t ADD c3 INT FIRST", packet_length=packet_length@entry=30, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.4_dbg/sql/sql_class.h:227 #17 0x0000562b147acf89 in do_command (thd=0x153cdc000d38) at /test/10.4_dbg/sql/sql_parse.cc:1378 #18 0x0000562b148c0e9c in do_handle_one_connection (connect=<optimized out>) at /test/10.4_dbg/sql/sql_connect.cc:1420 #19 0x0000562b148c0f65 in handle_one_connection (arg=<optimized out>) at /test/10.4_dbg/sql/sql_connect.cc:1324 #20 0x0000153d3b10ab43 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442 #21 0x0000153d3b19ca00 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81 Bug confirmed present in: MariaDB: 10.4.29 (dbg), 10.5.20 (dbg), 10.6.13 (dbg), 10.7.8 (dbg), 10.8.8 (dbg), 10.9.6 (dbg), 10.10.4 (dbg), 10.11.3 (dbg), 11.0.2 (dbg), 11.1.0 (dbg) Bug (or feature/syntax) confirmed not present in: MariaDB: 10.4.29 (opt), 10.5.20 (opt), 10.6.13 (opt), 10.7.8 (opt), 10.8.8 (opt), 10.9.6 (opt), 10.10.4 (opt), 10.11.3 (opt), 11.0.2 (opt), 11.1.0 (opt) MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.51 (dbg), 5.6.51 (opt), 5.7.40 (dbg), 5.7.40 (opt), 8.0.31 (dbg), 8.0.31 (opt)

            Test case:

            diff --git a/mysql-test/suite/innodb/t/instant_alter_bugs.test b/mysql-test/suite/innodb/t/instant_alter_bugs.test
            index debd5d30562..de14a87cf32 100644
            --- a/mysql-test/suite/innodb/t/instant_alter_bugs.test
            +++ b/mysql-test/suite/innodb/t/instant_alter_bugs.test
            @@ -1,4 +1,5 @@
             --source include/have_innodb.inc
            +--source include/have_sequence.inc
             
             SET @save_frequency= @@GLOBAL.innodb_purge_rseg_truncate_frequency;
             SET GLOBAL innodb_purge_rseg_truncate_frequency=1;
            @@ -526,4 +527,24 @@ CREATE TABLE t1 (i int AS (0) STORED, j INT) ENGINE=InnoDB;
             ALTER TABLE t1 ADD COLUMN i INT GENERATED ALWAYS AS (1), DROP COLUMN i;
             DROP TABLE t1;
             
            +--echo #
            +--echo # MDEV-18322 Assertion "wrong_page_type" on instant ALTER
            +--echo #
            +
            +DELIMITER $$;
            +BEGIN NOT ATOMIC
            +  DECLARE c TEXT DEFAULT(SELECT CONCAT('CREATE TABLE t1 (c',
            +                                       GROUP_CONCAT(seq SEPARATOR ' CHAR(200), c'),
            +                                       ' CHAR(211)) ENGINE=InnoDB ROW_FORMAT=REDUNDANT')
            +                                       FROM seq_1_to_40);
            +  EXECUTE IMMEDIATE c;
            +END;
            +$$
            +DELIMITER ;$$
            +--error ER_TOO_BIG_ROWSIZE
            +ALTER TABLE t1 ADD c41 INT FIRST;
            +--error ER_TOO_BIG_ROWSIZE
            +ALTER TABLE t1 ADD c41 INT FIRST;
            +DROP TABLE t1;
            +
             --echo # End of 10.4 tests
            

            The second ALTER TABLE would crash because the first one was not completely rolled back.

            marko Marko Mäkelä added a comment - Test case: diff --git a/mysql-test/suite/innodb/t/instant_alter_bugs.test b/mysql-test/suite/innodb/t/instant_alter_bugs.test index debd5d30562..de14a87cf32 100644 --- a/mysql-test/suite/innodb/t/instant_alter_bugs.test +++ b/mysql-test/suite/innodb/t/instant_alter_bugs.test @@ -1,4 +1,5 @@ --source include/have_innodb.inc +--source include/have_sequence.inc SET @save_frequency= @@GLOBAL.innodb_purge_rseg_truncate_frequency; SET GLOBAL innodb_purge_rseg_truncate_frequency=1; @@ -526,4 +527,24 @@ CREATE TABLE t1 (i int AS (0) STORED, j INT) ENGINE=InnoDB; ALTER TABLE t1 ADD COLUMN i INT GENERATED ALWAYS AS (1), DROP COLUMN i; DROP TABLE t1; +--echo # +--echo # MDEV-18322 Assertion "wrong_page_type" on instant ALTER +--echo # + +DELIMITER $$; +BEGIN NOT ATOMIC + DECLARE c TEXT DEFAULT(SELECT CONCAT('CREATE TABLE t1 (c', + GROUP_CONCAT(seq SEPARATOR ' CHAR(200), c'), + ' CHAR(211)) ENGINE=InnoDB ROW_FORMAT=REDUNDANT') + FROM seq_1_to_40); + EXECUTE IMMEDIATE c; +END; +$$ +DELIMITER ;$$ +--error ER_TOO_BIG_ROWSIZE +ALTER TABLE t1 ADD c41 INT FIRST; +--error ER_TOO_BIG_ROWSIZE +ALTER TABLE t1 ADD c41 INT FIRST; +DROP TABLE t1; + --echo # End of 10.4 tests The second ALTER TABLE would crash because the first one was not completely rolled back.
            marko Marko Mäkelä added a comment - - edited

            I created a separate 10.6 version of the fix.

            marko Marko Mäkelä added a comment - - edited I created a separate 10.6 version of the fix.

            origin/10.6-MDEV-18322 d139dde1ff440980b9c988487006ed91b13a614d 2023-12-12T17:19:33+02:00
            performed well in RQG testing.

            mleich Matthias Leich added a comment - origin/10.6- MDEV-18322 d139dde1ff440980b9c988487006ed91b13a614d 2023-12-12T17:19:33+02:00 performed well in RQG testing.

            People

              marko Marko Mäkelä
              elenst Elena Stepanova
              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.