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

Assertion `size == space->size' failed in buf_read_ahead_random

Details

    Description

      10.2 845e3c9801d

      mysqld: /home/elenst/MDEV-23439/10.2/storage/innobase/buf/buf0rea.cc:296: ulint buf_read_ahead_random(page_id_t, const page_size_t&, ulint): Assertion `size == space->size' failed.
      200810 10:58:31 [ERROR] mysqld got signal 6 ;
       
      #3  0x00007f1d678274a2 in __GI___assert_fail (assertion=0x5648a81141e1 "size == space->size", file=0x5648a8114580 "/home/elenst/MDEV-23439/10.2/storage/innobase/buf/buf0rea.cc", 
          line=296, 
          function=0x5648a8115000 <buf_read_ahead_random(page_id_t, page_size_t const&, unsigned long)::__PRETTY_FUNCTION__> "ulint buf_read_ahead_random(page_id_t, const page_size_t&, ulint)") at assert.c:101
      #4  0x00005648a7ba04e9 in buf_read_ahead_random (page_id=..., page_size=..., inside_ibuf=0) at /home/elenst/MDEV-23439/10.2/storage/innobase/buf/buf0rea.cc:296
      #5  0x00005648a7b7757a in buf_page_get_low (page_id=..., page_size=..., rw_latch=2, guess=0x0, mode=10, 
          file=0x5648a8135fe0 "/home/elenst/MDEV-23439/10.2/storage/innobase/fil/fil0fil.cc", line=4497, mtr=0x7f1d2c0a86d0, err=0x0)
          at /home/elenst/MDEV-23439/10.2/storage/innobase/buf/buf0buf.cc:4390
      #6  0x00005648a7b78c49 in buf_page_get_gen (page_id=..., page_size=..., rw_latch=2, guess=0x0, mode=10, 
          file=0x5648a8135fe0 "/home/elenst/MDEV-23439/10.2/storage/innobase/fil/fil0fil.cc", line=4497, mtr=0x7f1d2c0a86d0, err=0x0)
          at /home/elenst/MDEV-23439/10.2/storage/innobase/buf/buf0buf.cc:4908
      #7  0x00005648a7c012e0 in fsp_flags_try_adjust (space_id=1918, flags=41) at /home/elenst/MDEV-23439/10.2/storage/innobase/fil/fil0fil.cc:4495
      #8  0x00005648a7c015d0 in fil_space_for_table_exists_in_mem (id=1918, name=0x7f1ce00d2f90 "test/#sql2-20ea-e", table_flags=41)
          at /home/elenst/MDEV-23439/10.2/storage/innobase/fil/fil0fil.cc:4555
      #9  0x00005648a7a4e32d in row_drop_single_table_tablespace (space_id=1918, tablename=0x7f1ce00d2f90 "test/#sql2-20ea-e", filepath=0x7f1ce00f5b50 "./test/#sql2-20ea-e.ibd", 
          table_flags=41) at /home/elenst/MDEV-23439/10.2/storage/innobase/row/row0mysql.cc:3253
      #10 0x00005648a7a4f65c in row_drop_table_for_mysql (name=0x7f1d2c0a94f0 "test/#sql2-20ea-e", trx=0x7f1d650a1268, sqlcom=SQLCOM_ALTER_TABLE, create_failed=false, nonatomic=true)
          at /home/elenst/MDEV-23439/10.2/storage/innobase/row/row0mysql.cc:3740
      #11 0x00005648a792a488 in ha_innobase::delete_table (this=0x7f1ce0013590, name=0x7f1d2c0aacf0 "./test/#sql2-20ea-e", sqlcom=SQLCOM_ALTER_TABLE)
          at /home/elenst/MDEV-23439/10.2/storage/innobase/handler/ha_innodb.cc:13304
      #12 0x00005648a7914ff8 in ha_innobase::delete_table (this=0x7f1ce0013590, name=0x7f1d2c0aacf0 "./test/#sql2-20ea-e")
          at /home/elenst/MDEV-23439/10.2/storage/innobase/handler/ha_innodb.cc:13429
      #13 0x00005648a7712d1e in handler::ha_delete_table (this=0x7f1ce0013590, name=0x7f1d2c0aacf0 "./test/#sql2-20ea-e") at /home/elenst/MDEV-23439/10.2/sql/handler.cc:4473
      #14 0x00005648a770d441 in ha_delete_table (thd=0x7f1ce0000d50, table_type=0x5648ab13fa00, path=0x7f1d2c0aacf0 "./test/#sql2-20ea-e", db=0x7f1ce0011b30 "test", 
          alias=0x7f1d2c0ab0d0 "#sql2-20ea-e", generate_warning=false) at /home/elenst/MDEV-23439/10.2/sql/handler.cc:2442
      #15 0x00005648a75545ff in quick_rm_table (thd=0x7f1ce0000d50, base=0x5648ab13fa00, db=0x7f1ce0011b30 "test", table_name=0x7f1d2c0ab0d0 "#sql2-20ea-e", flags=3, table_path=0x0)
          at /home/elenst/MDEV-23439/10.2/sql/sql_table.cc:2734
      #16 0x00005648a7567ac8 in mysql_alter_table (thd=0x7f1ce0000d50, new_db=0x7f1ce0011b30 "test", new_name=0x0, create_info=0x7f1d2c0ac2c0, table_list=0x7f1ce0011518, 
          alter_info=0x7f1d2c0ac210, order_num=0, order=0x0, ignore=true) at /home/elenst/MDEV-23439/10.2/sql/sql_table.cc:9876
      #17 0x00005648a75e390b in Sql_cmd_alter_table::execute (this=0x7f1ce0011b60, thd=0x7f1ce0000d50) at /home/elenst/MDEV-23439/10.2/sql/sql_alter.cc:333
      #18 0x00005648a7496537 in mysql_execute_command (thd=0x7f1ce0000d50) at /home/elenst/MDEV-23439/10.2/sql/sql_parse.cc:5964
      #19 0x00005648a749b4cf in mysql_parse (thd=0x7f1ce0000d50, 
          rawbuf=0x7f1ce0011338 "ALTER /* QNO 122120 CON_ID 15 */ IGNORE TABLE alt_t5 /* 100301 WAIT 1 */ /*!100200 DROP CONSTRAINT IF EXISTS k */ /* COMMENT 'Skipped DROP CONSTRAINT' */", 
          length=153, parser_state=0x7f1d2c0ad640, is_com_multi=false, is_next_command=false) at /home/elenst/MDEV-23439/10.2/sql/sql_parse.cc:7733
      #20 0x00005648a74897db in dispatch_command (command=COM_QUERY, thd=0x7f1ce0000d50, packet=0x7f1ce0008b11 "", packet_length=153, is_com_multi=false, is_next_command=false)
          at /home/elenst/MDEV-23439/10.2/sql/sql_parse.cc:1823
      #21 0x00005648a7488258 in do_command (thd=0x7f1ce0000d50) at /home/elenst/MDEV-23439/10.2/sql/sql_parse.cc:1377
      #22 0x00005648a75de491 in do_handle_one_connection (connect=0x5648abc8afe0) at /home/elenst/MDEV-23439/10.2/sql/sql_connect.cc:1336
      #23 0x00005648a75de1fc in handle_one_connection (arg=0x5648abc8afe0) at /home/elenst/MDEV-23439/10.2/sql/sql_connect.cc:1241
      #24 0x00007f1d6852e6db in start_thread (arg=0x7f1d2c0ae700) at pthread_create.c:463
      #25 0x00007f1d67918a3f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      A test case for the reference is attached, although I don't know how useful it is for debugging, it is very big in size. Execution time in shm is actually not that bad, it fails for me on 10.2 debug in 2-3 min, but on disk it can take almost an hour. The test case is to be run with

      --mem --mysqld=--innodb --mysqld=--default-storage-engine=InnoDB --mysqld=--partition --mysqld=--loose-innodb-stats-persistent=on --mysqld=--character-set-server=utf8 --mysqld=--max-allowed-packet=128M --mysqld=--innodb-buffer-pool-size=128M --mysqld=--innodb-log-file-size=48M --mysqld=--log_bin_trust_function_creators=OFF --mysqld=--key_buffer_size=128M --mysqld=--performance-schema=OFF --mysqld=--log_output=FILE --mysqld=--max-statement-time=20 --mysqld=--loose-max-statement-time=10 --mysqld=--innodb-lock-wait-timeout=3 --mysqld=--lock-wait-timeout=5
      

      (not all options are important, but these has been used successfully).

      Only reproducible with this test case on 10.2, but the failure has been seen on 10.2-10.4. No observations for 10.5.

      rr profile is available.

      Attachments

        Issue Links

          Activity

            elenst Elena Stepanova created issue -
            elenst Elena Stepanova made changes -
            Field Original Value New Value
            Assignee Elena Stepanova [ elenst ]
            elenst Elena Stepanova made changes -
            Summary Assertion `size == space->size' failed in Assertion `size == space->size' failed in buf_read_ahead_random
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            Component/s Storage Engine - InnoDB [ 10129 ]
            Labels need_rr
            elenst Elena Stepanova made changes -
            Description {noformat:title=bb-10.2-release fbcae42c}
            mysqld: /home/elenst/src/bb-10.2-release/storage/innobase/buf/buf0rea.cc:296: ulint buf_read_ahead_random(page_id_t, const page_size_t&, ulint
            ): Assertion `size == space->size' failed.
            200809 5:49:14 [ERROR] mysqld got signal 6 ;

            #7 0x00007f34c5da10d2 in __assert_fail () from /lib64/libc.so.6
            #8 0x0000558016b6dcd6 in buf_read_ahead_random (page_id=..., page_size=..., inside_ibuf=0) at /home/elenst/src/bb-10.2-release/storage/innobase/buf/buf0rea.cc:296
            #9 0x0000558016b453e6 in buf_page_get_low (page_id=..., page_size=..., rw_latch=2, guess=0x0, mode=10, file=0x558017162ac0 "/home/elenst/src/bb-10.2-release/storage/innobase/fil/fil0fil.cc", line=4497, mtr=0x7f34c4297240, err=0x0) at /home/elenst/src/bb-10.2-release/storage/innobase/buf/buf0buf.cc:4391
            #10 0x0000558016b46a19 in buf_page_get_gen (page_id=..., page_size=..., rw_latch=2, guess=0x0, mode=10, file=0x558017162ac0 "/home/elenst/src/bb-10.2-release/storage/innobase/fil/fil0fil.cc", line=4497, mtr=0x7f34c4297240, err=0x0) at /home/elenst/src/bb-10.2-release/storage/innobase/buf/buf0buf.cc:4908
            #11 0x0000558016bcc74b in fsp_flags_try_adjust (space_id=2007, flags=41) at /home/elenst/src/bb-10.2-release/storage/innobase/fil/fil0fil.cc:4495
            #12 0x0000558016bcca31 in fil_space_for_table_exists_in_mem (id=2007, name=0x7f345506a2b0 "test/#sql2-1a70d-f", table_flags=41) at /home/elenst/src/bb-10.2-release/storage/innobase/fil/fil0fil.cc:4555
            #13 0x0000558016a1f8fe in row_drop_single_table_tablespace (space_id=2007, tablename=0x7f345506a2b0 "test/#sql2-1a70d-f", filepath=0x7f3454417f40 "./test/#sql2-1a70d-f.ibd", table_flags=41) at /home/elenst/src/bb-10.2-release/storage/innobase/row/row0mysql.cc:3254
            #14 0x0000558016a20c0e in row_drop_table_for_mysql (name=0x7f34c4298470 "test/#sql2-1a70d-f", trx=0x7f34b0186390, sqlcom=SQLCOM_ALTER_TABLE, create_failed=false, nonatomic=true) at /home/elenst/src/bb-10.2-release/storage/innobase/row/row0mysql.cc:3741
            #15 0x00005580168ffeef in ha_innobase::delete_table (this=0x7f3454015440, name=0x7f34c4299c70 "./test/#sql2-1a70d-f", sqlcom=SQLCOM_ALTER_TABLE) at /home/elenst/src/bb-10.2-release/storage/innobase/handler/ha_innodb.cc:13304
            #16 0x00005580168eacda in ha_innobase::delete_table (this=0x7f3454015440, name=0x7f34c4299c70 "./test/#sql2-1a70d-f") at /home/elenst/src/bb-10.2-release/storage/innobase/handler/ha_innodb.cc:13429
            #17 0x00005580166b53a6 in handler::ha_delete_table (this=0x7f3454015440, name=0x7f34c4299c70 "./test/#sql2-1a70d-f") at /home/elenst/src/bb-10.2-release/sql/handler.cc:4473
            #18 0x00005580166afb88 in ha_delete_table (thd=0x7f3454000af0, table_type=0x558019f19ea0, path=0x7f34c4299c70 "./test/#sql2-1a70d-f", db=0x7f34540139e0 "test", alias=0x7f34c429a090 "#sql2-1a70d-f", generate_warning=false) at /home/elenst/src/bb-10.2-release/sql/handler.cc:2442
            #19 0x00005580164ef0bd in quick_rm_table (thd=0x7f3454000af0, base=0x558019f19ea0, db=0x7f34540139e0 "test", table_name=0x7f34c429a090 "#sql2-1a70d-f", flags=3, table_path=0x0) at /home/elenst/src/bb-10.2-release/sql/sql_table.cc:2734
            #20 0x0000558016502567 in mysql_alter_table (thd=0x7f3454000af0, new_db=0x7f34540139e0 "test", new_name=0x0, create_info=0x7f34c429b280, table_list=0x7f34540133c8, alter_info=0x7f34c429b1d0, order_num=0, order=0x0, ignore=true) at /home/elenst/src/bb-10.2-release/sql/sql_table.cc:9876
            #21 0x000055801657fd61 in Sql_cmd_alter_table::execute (this=0x7f3454013a10, thd=0x7f3454000af0) at /home/elenst/src/bb-10.2-release/sql/sql_alter.cc:339
            #22 0x00005580164306a7 in mysql_execute_command (thd=0x7f3454000af0) at /home/elenst/src/bb-10.2-release/sql/sql_parse.cc:5964
            #23 0x00005580164353bb in mysql_parse (thd=0x7f3454000af0, rawbuf=0x7f34540131e8 "ALTER /* QNO 122120 CON_ID 15 */ IGNORE TABLE alt_t5 /* 100301 WAIT 1 */ /*!100200 DROP CONSTRAINT IF EXISTS k */ /* COMMENT 'Skipped DROP CONSTRAINT' */", length=153, parser_state=0x7f34c429c660, is_com_multi=false, is_next_command=false) at /home/elenst/src/bb-10.2-release/sql/sql_parse.cc:7733
            #24 0x0000558016423782 in dispatch_command (command=COM_QUERY, thd=0x7f3454000af0, packet=0x7f34548aa2a1 "ALTER /* QNO 122120 CON_ID 15 */ IGNORE TABLE alt_t5 /*!100301 WAIT 1 */ /*!100200 DROP CONSTRAINT IF EXISTS k */ /* COMMENT 'Skipped DROP CONSTRAINT' */ ", packet_length=154, is_com_multi=false, is_next_command=false) at /home/elenst/src/bb-10.2-release/sql/sql_parse.cc:1824
            #25 0x0000558016422128 in do_command (thd=0x7f3454000af0) at /home/elenst/src/bb-10.2-release/sql/sql_parse.cc:1378
            #26 0x000055801657a94d in do_handle_one_connection (connect=0x55801a936920) at /home/elenst/src/bb-10.2-release/sql/sql_connect.cc:1336
            #27 0x000055801657a698 in handle_one_connection (arg=0x55801a936920) at /home/elenst/src/bb-10.2-release/sql/sql_connect.cc:1241
            #28 0x00007f34c73dedd5 in start_thread () from /lib64/libpthread.so.0
            #29 0x00007f34c5e6fead in clone () from /lib64/libc.so.6
            {noformat}
            {noformat:title=10.2 845e3c9801d}
            mysqld: /home/elenst/MDEV-23439/10.2/storage/innobase/buf/buf0rea.cc:296: ulint buf_read_ahead_random(page_id_t, const page_size_t&, ulint): Assertion `size == space->size' failed.
            200810 10:58:31 [ERROR] mysqld got signal 6 ;

            #3 0x00007f1d678274a2 in __GI___assert_fail (assertion=0x5648a81141e1 "size == space->size", file=0x5648a8114580 "/home/elenst/MDEV-23439/10.2/storage/innobase/buf/buf0rea.cc",
                line=296,
                function=0x5648a8115000 <buf_read_ahead_random(page_id_t, page_size_t const&, unsigned long)::__PRETTY_FUNCTION__> "ulint buf_read_ahead_random(page_id_t, const page_size_t&, ulint)") at assert.c:101
            #4 0x00005648a7ba04e9 in buf_read_ahead_random (page_id=..., page_size=..., inside_ibuf=0) at /home/elenst/MDEV-23439/10.2/storage/innobase/buf/buf0rea.cc:296
            #5 0x00005648a7b7757a in buf_page_get_low (page_id=..., page_size=..., rw_latch=2, guess=0x0, mode=10,
                file=0x5648a8135fe0 "/home/elenst/MDEV-23439/10.2/storage/innobase/fil/fil0fil.cc", line=4497, mtr=0x7f1d2c0a86d0, err=0x0)
                at /home/elenst/MDEV-23439/10.2/storage/innobase/buf/buf0buf.cc:4390
            #6 0x00005648a7b78c49 in buf_page_get_gen (page_id=..., page_size=..., rw_latch=2, guess=0x0, mode=10,
                file=0x5648a8135fe0 "/home/elenst/MDEV-23439/10.2/storage/innobase/fil/fil0fil.cc", line=4497, mtr=0x7f1d2c0a86d0, err=0x0)
                at /home/elenst/MDEV-23439/10.2/storage/innobase/buf/buf0buf.cc:4908
            #7 0x00005648a7c012e0 in fsp_flags_try_adjust (space_id=1918, flags=41) at /home/elenst/MDEV-23439/10.2/storage/innobase/fil/fil0fil.cc:4495
            #8 0x00005648a7c015d0 in fil_space_for_table_exists_in_mem (id=1918, name=0x7f1ce00d2f90 "test/#sql2-20ea-e", table_flags=41)
                at /home/elenst/MDEV-23439/10.2/storage/innobase/fil/fil0fil.cc:4555
            #9 0x00005648a7a4e32d in row_drop_single_table_tablespace (space_id=1918, tablename=0x7f1ce00d2f90 "test/#sql2-20ea-e", filepath=0x7f1ce00f5b50 "./test/#sql2-20ea-e.ibd",
                table_flags=41) at /home/elenst/MDEV-23439/10.2/storage/innobase/row/row0mysql.cc:3253
            #10 0x00005648a7a4f65c in row_drop_table_for_mysql (name=0x7f1d2c0a94f0 "test/#sql2-20ea-e", trx=0x7f1d650a1268, sqlcom=SQLCOM_ALTER_TABLE, create_failed=false, nonatomic=true)
                at /home/elenst/MDEV-23439/10.2/storage/innobase/row/row0mysql.cc:3740
            #11 0x00005648a792a488 in ha_innobase::delete_table (this=0x7f1ce0013590, name=0x7f1d2c0aacf0 "./test/#sql2-20ea-e", sqlcom=SQLCOM_ALTER_TABLE)
                at /home/elenst/MDEV-23439/10.2/storage/innobase/handler/ha_innodb.cc:13304
            #12 0x00005648a7914ff8 in ha_innobase::delete_table (this=0x7f1ce0013590, name=0x7f1d2c0aacf0 "./test/#sql2-20ea-e")
                at /home/elenst/MDEV-23439/10.2/storage/innobase/handler/ha_innodb.cc:13429
            #13 0x00005648a7712d1e in handler::ha_delete_table (this=0x7f1ce0013590, name=0x7f1d2c0aacf0 "./test/#sql2-20ea-e") at /home/elenst/MDEV-23439/10.2/sql/handler.cc:4473
            #14 0x00005648a770d441 in ha_delete_table (thd=0x7f1ce0000d50, table_type=0x5648ab13fa00, path=0x7f1d2c0aacf0 "./test/#sql2-20ea-e", db=0x7f1ce0011b30 "test",
                alias=0x7f1d2c0ab0d0 "#sql2-20ea-e", generate_warning=false) at /home/elenst/MDEV-23439/10.2/sql/handler.cc:2442
            #15 0x00005648a75545ff in quick_rm_table (thd=0x7f1ce0000d50, base=0x5648ab13fa00, db=0x7f1ce0011b30 "test", table_name=0x7f1d2c0ab0d0 "#sql2-20ea-e", flags=3, table_path=0x0)
                at /home/elenst/MDEV-23439/10.2/sql/sql_table.cc:2734
            #16 0x00005648a7567ac8 in mysql_alter_table (thd=0x7f1ce0000d50, new_db=0x7f1ce0011b30 "test", new_name=0x0, create_info=0x7f1d2c0ac2c0, table_list=0x7f1ce0011518,
                alter_info=0x7f1d2c0ac210, order_num=0, order=0x0, ignore=true) at /home/elenst/MDEV-23439/10.2/sql/sql_table.cc:9876
            #17 0x00005648a75e390b in Sql_cmd_alter_table::execute (this=0x7f1ce0011b60, thd=0x7f1ce0000d50) at /home/elenst/MDEV-23439/10.2/sql/sql_alter.cc:333
            #18 0x00005648a7496537 in mysql_execute_command (thd=0x7f1ce0000d50) at /home/elenst/MDEV-23439/10.2/sql/sql_parse.cc:5964
            #19 0x00005648a749b4cf in mysql_parse (thd=0x7f1ce0000d50,
                rawbuf=0x7f1ce0011338 "ALTER /* QNO 122120 CON_ID 15 */ IGNORE TABLE alt_t5 /* 100301 WAIT 1 */ /*!100200 DROP CONSTRAINT IF EXISTS k */ /* COMMENT 'Skipped DROP CONSTRAINT' */",
                length=153, parser_state=0x7f1d2c0ad640, is_com_multi=false, is_next_command=false) at /home/elenst/MDEV-23439/10.2/sql/sql_parse.cc:7733
            #20 0x00005648a74897db in dispatch_command (command=COM_QUERY, thd=0x7f1ce0000d50, packet=0x7f1ce0008b11 "", packet_length=153, is_com_multi=false, is_next_command=false)
                at /home/elenst/MDEV-23439/10.2/sql/sql_parse.cc:1823
            #21 0x00005648a7488258 in do_command (thd=0x7f1ce0000d50) at /home/elenst/MDEV-23439/10.2/sql/sql_parse.cc:1377
            #22 0x00005648a75de491 in do_handle_one_connection (connect=0x5648abc8afe0) at /home/elenst/MDEV-23439/10.2/sql/sql_connect.cc:1336
            #23 0x00005648a75de1fc in handle_one_connection (arg=0x5648abc8afe0) at /home/elenst/MDEV-23439/10.2/sql/sql_connect.cc:1241
            #24 0x00007f1d6852e6db in start_thread (arg=0x7f1d2c0ae700) at pthread_create.c:463
            #25 0x00007f1d67918a3f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
            {noformat}

            A test case for the reference is attached, although I don't know how useful it is for debugging, it is very big in size. Execution time in shm is actually not that bad, it fails for me on 10.2 debug in 2-3 min, but on disk it can take almost an hour.

            rr profile is available.
            elenst Elena Stepanova made changes -
            Attachment mdev23439a.test.gz [ 53109 ]
            elenst Elena Stepanova made changes -
            Description {noformat:title=10.2 845e3c9801d}
            mysqld: /home/elenst/MDEV-23439/10.2/storage/innobase/buf/buf0rea.cc:296: ulint buf_read_ahead_random(page_id_t, const page_size_t&, ulint): Assertion `size == space->size' failed.
            200810 10:58:31 [ERROR] mysqld got signal 6 ;

            #3 0x00007f1d678274a2 in __GI___assert_fail (assertion=0x5648a81141e1 "size == space->size", file=0x5648a8114580 "/home/elenst/MDEV-23439/10.2/storage/innobase/buf/buf0rea.cc",
                line=296,
                function=0x5648a8115000 <buf_read_ahead_random(page_id_t, page_size_t const&, unsigned long)::__PRETTY_FUNCTION__> "ulint buf_read_ahead_random(page_id_t, const page_size_t&, ulint)") at assert.c:101
            #4 0x00005648a7ba04e9 in buf_read_ahead_random (page_id=..., page_size=..., inside_ibuf=0) at /home/elenst/MDEV-23439/10.2/storage/innobase/buf/buf0rea.cc:296
            #5 0x00005648a7b7757a in buf_page_get_low (page_id=..., page_size=..., rw_latch=2, guess=0x0, mode=10,
                file=0x5648a8135fe0 "/home/elenst/MDEV-23439/10.2/storage/innobase/fil/fil0fil.cc", line=4497, mtr=0x7f1d2c0a86d0, err=0x0)
                at /home/elenst/MDEV-23439/10.2/storage/innobase/buf/buf0buf.cc:4390
            #6 0x00005648a7b78c49 in buf_page_get_gen (page_id=..., page_size=..., rw_latch=2, guess=0x0, mode=10,
                file=0x5648a8135fe0 "/home/elenst/MDEV-23439/10.2/storage/innobase/fil/fil0fil.cc", line=4497, mtr=0x7f1d2c0a86d0, err=0x0)
                at /home/elenst/MDEV-23439/10.2/storage/innobase/buf/buf0buf.cc:4908
            #7 0x00005648a7c012e0 in fsp_flags_try_adjust (space_id=1918, flags=41) at /home/elenst/MDEV-23439/10.2/storage/innobase/fil/fil0fil.cc:4495
            #8 0x00005648a7c015d0 in fil_space_for_table_exists_in_mem (id=1918, name=0x7f1ce00d2f90 "test/#sql2-20ea-e", table_flags=41)
                at /home/elenst/MDEV-23439/10.2/storage/innobase/fil/fil0fil.cc:4555
            #9 0x00005648a7a4e32d in row_drop_single_table_tablespace (space_id=1918, tablename=0x7f1ce00d2f90 "test/#sql2-20ea-e", filepath=0x7f1ce00f5b50 "./test/#sql2-20ea-e.ibd",
                table_flags=41) at /home/elenst/MDEV-23439/10.2/storage/innobase/row/row0mysql.cc:3253
            #10 0x00005648a7a4f65c in row_drop_table_for_mysql (name=0x7f1d2c0a94f0 "test/#sql2-20ea-e", trx=0x7f1d650a1268, sqlcom=SQLCOM_ALTER_TABLE, create_failed=false, nonatomic=true)
                at /home/elenst/MDEV-23439/10.2/storage/innobase/row/row0mysql.cc:3740
            #11 0x00005648a792a488 in ha_innobase::delete_table (this=0x7f1ce0013590, name=0x7f1d2c0aacf0 "./test/#sql2-20ea-e", sqlcom=SQLCOM_ALTER_TABLE)
                at /home/elenst/MDEV-23439/10.2/storage/innobase/handler/ha_innodb.cc:13304
            #12 0x00005648a7914ff8 in ha_innobase::delete_table (this=0x7f1ce0013590, name=0x7f1d2c0aacf0 "./test/#sql2-20ea-e")
                at /home/elenst/MDEV-23439/10.2/storage/innobase/handler/ha_innodb.cc:13429
            #13 0x00005648a7712d1e in handler::ha_delete_table (this=0x7f1ce0013590, name=0x7f1d2c0aacf0 "./test/#sql2-20ea-e") at /home/elenst/MDEV-23439/10.2/sql/handler.cc:4473
            #14 0x00005648a770d441 in ha_delete_table (thd=0x7f1ce0000d50, table_type=0x5648ab13fa00, path=0x7f1d2c0aacf0 "./test/#sql2-20ea-e", db=0x7f1ce0011b30 "test",
                alias=0x7f1d2c0ab0d0 "#sql2-20ea-e", generate_warning=false) at /home/elenst/MDEV-23439/10.2/sql/handler.cc:2442
            #15 0x00005648a75545ff in quick_rm_table (thd=0x7f1ce0000d50, base=0x5648ab13fa00, db=0x7f1ce0011b30 "test", table_name=0x7f1d2c0ab0d0 "#sql2-20ea-e", flags=3, table_path=0x0)
                at /home/elenst/MDEV-23439/10.2/sql/sql_table.cc:2734
            #16 0x00005648a7567ac8 in mysql_alter_table (thd=0x7f1ce0000d50, new_db=0x7f1ce0011b30 "test", new_name=0x0, create_info=0x7f1d2c0ac2c0, table_list=0x7f1ce0011518,
                alter_info=0x7f1d2c0ac210, order_num=0, order=0x0, ignore=true) at /home/elenst/MDEV-23439/10.2/sql/sql_table.cc:9876
            #17 0x00005648a75e390b in Sql_cmd_alter_table::execute (this=0x7f1ce0011b60, thd=0x7f1ce0000d50) at /home/elenst/MDEV-23439/10.2/sql/sql_alter.cc:333
            #18 0x00005648a7496537 in mysql_execute_command (thd=0x7f1ce0000d50) at /home/elenst/MDEV-23439/10.2/sql/sql_parse.cc:5964
            #19 0x00005648a749b4cf in mysql_parse (thd=0x7f1ce0000d50,
                rawbuf=0x7f1ce0011338 "ALTER /* QNO 122120 CON_ID 15 */ IGNORE TABLE alt_t5 /* 100301 WAIT 1 */ /*!100200 DROP CONSTRAINT IF EXISTS k */ /* COMMENT 'Skipped DROP CONSTRAINT' */",
                length=153, parser_state=0x7f1d2c0ad640, is_com_multi=false, is_next_command=false) at /home/elenst/MDEV-23439/10.2/sql/sql_parse.cc:7733
            #20 0x00005648a74897db in dispatch_command (command=COM_QUERY, thd=0x7f1ce0000d50, packet=0x7f1ce0008b11 "", packet_length=153, is_com_multi=false, is_next_command=false)
                at /home/elenst/MDEV-23439/10.2/sql/sql_parse.cc:1823
            #21 0x00005648a7488258 in do_command (thd=0x7f1ce0000d50) at /home/elenst/MDEV-23439/10.2/sql/sql_parse.cc:1377
            #22 0x00005648a75de491 in do_handle_one_connection (connect=0x5648abc8afe0) at /home/elenst/MDEV-23439/10.2/sql/sql_connect.cc:1336
            #23 0x00005648a75de1fc in handle_one_connection (arg=0x5648abc8afe0) at /home/elenst/MDEV-23439/10.2/sql/sql_connect.cc:1241
            #24 0x00007f1d6852e6db in start_thread (arg=0x7f1d2c0ae700) at pthread_create.c:463
            #25 0x00007f1d67918a3f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
            {noformat}

            A test case for the reference is attached, although I don't know how useful it is for debugging, it is very big in size. Execution time in shm is actually not that bad, it fails for me on 10.2 debug in 2-3 min, but on disk it can take almost an hour.

            rr profile is available.
            {noformat:title=10.2 845e3c9801d}
            mysqld: /home/elenst/MDEV-23439/10.2/storage/innobase/buf/buf0rea.cc:296: ulint buf_read_ahead_random(page_id_t, const page_size_t&, ulint): Assertion `size == space->size' failed.
            200810 10:58:31 [ERROR] mysqld got signal 6 ;

            #3 0x00007f1d678274a2 in __GI___assert_fail (assertion=0x5648a81141e1 "size == space->size", file=0x5648a8114580 "/home/elenst/MDEV-23439/10.2/storage/innobase/buf/buf0rea.cc",
                line=296,
                function=0x5648a8115000 <buf_read_ahead_random(page_id_t, page_size_t const&, unsigned long)::__PRETTY_FUNCTION__> "ulint buf_read_ahead_random(page_id_t, const page_size_t&, ulint)") at assert.c:101
            #4 0x00005648a7ba04e9 in buf_read_ahead_random (page_id=..., page_size=..., inside_ibuf=0) at /home/elenst/MDEV-23439/10.2/storage/innobase/buf/buf0rea.cc:296
            #5 0x00005648a7b7757a in buf_page_get_low (page_id=..., page_size=..., rw_latch=2, guess=0x0, mode=10,
                file=0x5648a8135fe0 "/home/elenst/MDEV-23439/10.2/storage/innobase/fil/fil0fil.cc", line=4497, mtr=0x7f1d2c0a86d0, err=0x0)
                at /home/elenst/MDEV-23439/10.2/storage/innobase/buf/buf0buf.cc:4390
            #6 0x00005648a7b78c49 in buf_page_get_gen (page_id=..., page_size=..., rw_latch=2, guess=0x0, mode=10,
                file=0x5648a8135fe0 "/home/elenst/MDEV-23439/10.2/storage/innobase/fil/fil0fil.cc", line=4497, mtr=0x7f1d2c0a86d0, err=0x0)
                at /home/elenst/MDEV-23439/10.2/storage/innobase/buf/buf0buf.cc:4908
            #7 0x00005648a7c012e0 in fsp_flags_try_adjust (space_id=1918, flags=41) at /home/elenst/MDEV-23439/10.2/storage/innobase/fil/fil0fil.cc:4495
            #8 0x00005648a7c015d0 in fil_space_for_table_exists_in_mem (id=1918, name=0x7f1ce00d2f90 "test/#sql2-20ea-e", table_flags=41)
                at /home/elenst/MDEV-23439/10.2/storage/innobase/fil/fil0fil.cc:4555
            #9 0x00005648a7a4e32d in row_drop_single_table_tablespace (space_id=1918, tablename=0x7f1ce00d2f90 "test/#sql2-20ea-e", filepath=0x7f1ce00f5b50 "./test/#sql2-20ea-e.ibd",
                table_flags=41) at /home/elenst/MDEV-23439/10.2/storage/innobase/row/row0mysql.cc:3253
            #10 0x00005648a7a4f65c in row_drop_table_for_mysql (name=0x7f1d2c0a94f0 "test/#sql2-20ea-e", trx=0x7f1d650a1268, sqlcom=SQLCOM_ALTER_TABLE, create_failed=false, nonatomic=true)
                at /home/elenst/MDEV-23439/10.2/storage/innobase/row/row0mysql.cc:3740
            #11 0x00005648a792a488 in ha_innobase::delete_table (this=0x7f1ce0013590, name=0x7f1d2c0aacf0 "./test/#sql2-20ea-e", sqlcom=SQLCOM_ALTER_TABLE)
                at /home/elenst/MDEV-23439/10.2/storage/innobase/handler/ha_innodb.cc:13304
            #12 0x00005648a7914ff8 in ha_innobase::delete_table (this=0x7f1ce0013590, name=0x7f1d2c0aacf0 "./test/#sql2-20ea-e")
                at /home/elenst/MDEV-23439/10.2/storage/innobase/handler/ha_innodb.cc:13429
            #13 0x00005648a7712d1e in handler::ha_delete_table (this=0x7f1ce0013590, name=0x7f1d2c0aacf0 "./test/#sql2-20ea-e") at /home/elenst/MDEV-23439/10.2/sql/handler.cc:4473
            #14 0x00005648a770d441 in ha_delete_table (thd=0x7f1ce0000d50, table_type=0x5648ab13fa00, path=0x7f1d2c0aacf0 "./test/#sql2-20ea-e", db=0x7f1ce0011b30 "test",
                alias=0x7f1d2c0ab0d0 "#sql2-20ea-e", generate_warning=false) at /home/elenst/MDEV-23439/10.2/sql/handler.cc:2442
            #15 0x00005648a75545ff in quick_rm_table (thd=0x7f1ce0000d50, base=0x5648ab13fa00, db=0x7f1ce0011b30 "test", table_name=0x7f1d2c0ab0d0 "#sql2-20ea-e", flags=3, table_path=0x0)
                at /home/elenst/MDEV-23439/10.2/sql/sql_table.cc:2734
            #16 0x00005648a7567ac8 in mysql_alter_table (thd=0x7f1ce0000d50, new_db=0x7f1ce0011b30 "test", new_name=0x0, create_info=0x7f1d2c0ac2c0, table_list=0x7f1ce0011518,
                alter_info=0x7f1d2c0ac210, order_num=0, order=0x0, ignore=true) at /home/elenst/MDEV-23439/10.2/sql/sql_table.cc:9876
            #17 0x00005648a75e390b in Sql_cmd_alter_table::execute (this=0x7f1ce0011b60, thd=0x7f1ce0000d50) at /home/elenst/MDEV-23439/10.2/sql/sql_alter.cc:333
            #18 0x00005648a7496537 in mysql_execute_command (thd=0x7f1ce0000d50) at /home/elenst/MDEV-23439/10.2/sql/sql_parse.cc:5964
            #19 0x00005648a749b4cf in mysql_parse (thd=0x7f1ce0000d50,
                rawbuf=0x7f1ce0011338 "ALTER /* QNO 122120 CON_ID 15 */ IGNORE TABLE alt_t5 /* 100301 WAIT 1 */ /*!100200 DROP CONSTRAINT IF EXISTS k */ /* COMMENT 'Skipped DROP CONSTRAINT' */",
                length=153, parser_state=0x7f1d2c0ad640, is_com_multi=false, is_next_command=false) at /home/elenst/MDEV-23439/10.2/sql/sql_parse.cc:7733
            #20 0x00005648a74897db in dispatch_command (command=COM_QUERY, thd=0x7f1ce0000d50, packet=0x7f1ce0008b11 "", packet_length=153, is_com_multi=false, is_next_command=false)
                at /home/elenst/MDEV-23439/10.2/sql/sql_parse.cc:1823
            #21 0x00005648a7488258 in do_command (thd=0x7f1ce0000d50) at /home/elenst/MDEV-23439/10.2/sql/sql_parse.cc:1377
            #22 0x00005648a75de491 in do_handle_one_connection (connect=0x5648abc8afe0) at /home/elenst/MDEV-23439/10.2/sql/sql_connect.cc:1336
            #23 0x00005648a75de1fc in handle_one_connection (arg=0x5648abc8afe0) at /home/elenst/MDEV-23439/10.2/sql/sql_connect.cc:1241
            #24 0x00007f1d6852e6db in start_thread (arg=0x7f1d2c0ae700) at pthread_create.c:463
            #25 0x00007f1d67918a3f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
            {noformat}

            A test case for the reference is attached, although I don't know how useful it is for debugging, it is very big in size. Execution time in shm is actually not that bad, it fails for me on 10.2 debug in 2-3 min, but on disk it can take almost an hour.

            Only reproducible with this test case on 10.2, but the failure has been seen on 10.2-10.4. No observations for 10.5.

            rr profile is available.
            elenst Elena Stepanova made changes -
            Fix Version/s 10.2 [ 14601 ]
            Fix Version/s 10.3 [ 22126 ]
            Fix Version/s 10.4 [ 22408 ]
            Affects Version/s 10.2 [ 14601 ]
            Affects Version/s 10.3 [ 22126 ]
            Affects Version/s 10.4 [ 22408 ]
            elenst Elena Stepanova made changes -
            Assignee Elena Stepanova [ elenst ] Marko Mäkelä [ marko ]
            Labels need_rr rr-profile
            elenst Elena Stepanova made changes -
            Description {noformat:title=10.2 845e3c9801d}
            mysqld: /home/elenst/MDEV-23439/10.2/storage/innobase/buf/buf0rea.cc:296: ulint buf_read_ahead_random(page_id_t, const page_size_t&, ulint): Assertion `size == space->size' failed.
            200810 10:58:31 [ERROR] mysqld got signal 6 ;

            #3 0x00007f1d678274a2 in __GI___assert_fail (assertion=0x5648a81141e1 "size == space->size", file=0x5648a8114580 "/home/elenst/MDEV-23439/10.2/storage/innobase/buf/buf0rea.cc",
                line=296,
                function=0x5648a8115000 <buf_read_ahead_random(page_id_t, page_size_t const&, unsigned long)::__PRETTY_FUNCTION__> "ulint buf_read_ahead_random(page_id_t, const page_size_t&, ulint)") at assert.c:101
            #4 0x00005648a7ba04e9 in buf_read_ahead_random (page_id=..., page_size=..., inside_ibuf=0) at /home/elenst/MDEV-23439/10.2/storage/innobase/buf/buf0rea.cc:296
            #5 0x00005648a7b7757a in buf_page_get_low (page_id=..., page_size=..., rw_latch=2, guess=0x0, mode=10,
                file=0x5648a8135fe0 "/home/elenst/MDEV-23439/10.2/storage/innobase/fil/fil0fil.cc", line=4497, mtr=0x7f1d2c0a86d0, err=0x0)
                at /home/elenst/MDEV-23439/10.2/storage/innobase/buf/buf0buf.cc:4390
            #6 0x00005648a7b78c49 in buf_page_get_gen (page_id=..., page_size=..., rw_latch=2, guess=0x0, mode=10,
                file=0x5648a8135fe0 "/home/elenst/MDEV-23439/10.2/storage/innobase/fil/fil0fil.cc", line=4497, mtr=0x7f1d2c0a86d0, err=0x0)
                at /home/elenst/MDEV-23439/10.2/storage/innobase/buf/buf0buf.cc:4908
            #7 0x00005648a7c012e0 in fsp_flags_try_adjust (space_id=1918, flags=41) at /home/elenst/MDEV-23439/10.2/storage/innobase/fil/fil0fil.cc:4495
            #8 0x00005648a7c015d0 in fil_space_for_table_exists_in_mem (id=1918, name=0x7f1ce00d2f90 "test/#sql2-20ea-e", table_flags=41)
                at /home/elenst/MDEV-23439/10.2/storage/innobase/fil/fil0fil.cc:4555
            #9 0x00005648a7a4e32d in row_drop_single_table_tablespace (space_id=1918, tablename=0x7f1ce00d2f90 "test/#sql2-20ea-e", filepath=0x7f1ce00f5b50 "./test/#sql2-20ea-e.ibd",
                table_flags=41) at /home/elenst/MDEV-23439/10.2/storage/innobase/row/row0mysql.cc:3253
            #10 0x00005648a7a4f65c in row_drop_table_for_mysql (name=0x7f1d2c0a94f0 "test/#sql2-20ea-e", trx=0x7f1d650a1268, sqlcom=SQLCOM_ALTER_TABLE, create_failed=false, nonatomic=true)
                at /home/elenst/MDEV-23439/10.2/storage/innobase/row/row0mysql.cc:3740
            #11 0x00005648a792a488 in ha_innobase::delete_table (this=0x7f1ce0013590, name=0x7f1d2c0aacf0 "./test/#sql2-20ea-e", sqlcom=SQLCOM_ALTER_TABLE)
                at /home/elenst/MDEV-23439/10.2/storage/innobase/handler/ha_innodb.cc:13304
            #12 0x00005648a7914ff8 in ha_innobase::delete_table (this=0x7f1ce0013590, name=0x7f1d2c0aacf0 "./test/#sql2-20ea-e")
                at /home/elenst/MDEV-23439/10.2/storage/innobase/handler/ha_innodb.cc:13429
            #13 0x00005648a7712d1e in handler::ha_delete_table (this=0x7f1ce0013590, name=0x7f1d2c0aacf0 "./test/#sql2-20ea-e") at /home/elenst/MDEV-23439/10.2/sql/handler.cc:4473
            #14 0x00005648a770d441 in ha_delete_table (thd=0x7f1ce0000d50, table_type=0x5648ab13fa00, path=0x7f1d2c0aacf0 "./test/#sql2-20ea-e", db=0x7f1ce0011b30 "test",
                alias=0x7f1d2c0ab0d0 "#sql2-20ea-e", generate_warning=false) at /home/elenst/MDEV-23439/10.2/sql/handler.cc:2442
            #15 0x00005648a75545ff in quick_rm_table (thd=0x7f1ce0000d50, base=0x5648ab13fa00, db=0x7f1ce0011b30 "test", table_name=0x7f1d2c0ab0d0 "#sql2-20ea-e", flags=3, table_path=0x0)
                at /home/elenst/MDEV-23439/10.2/sql/sql_table.cc:2734
            #16 0x00005648a7567ac8 in mysql_alter_table (thd=0x7f1ce0000d50, new_db=0x7f1ce0011b30 "test", new_name=0x0, create_info=0x7f1d2c0ac2c0, table_list=0x7f1ce0011518,
                alter_info=0x7f1d2c0ac210, order_num=0, order=0x0, ignore=true) at /home/elenst/MDEV-23439/10.2/sql/sql_table.cc:9876
            #17 0x00005648a75e390b in Sql_cmd_alter_table::execute (this=0x7f1ce0011b60, thd=0x7f1ce0000d50) at /home/elenst/MDEV-23439/10.2/sql/sql_alter.cc:333
            #18 0x00005648a7496537 in mysql_execute_command (thd=0x7f1ce0000d50) at /home/elenst/MDEV-23439/10.2/sql/sql_parse.cc:5964
            #19 0x00005648a749b4cf in mysql_parse (thd=0x7f1ce0000d50,
                rawbuf=0x7f1ce0011338 "ALTER /* QNO 122120 CON_ID 15 */ IGNORE TABLE alt_t5 /* 100301 WAIT 1 */ /*!100200 DROP CONSTRAINT IF EXISTS k */ /* COMMENT 'Skipped DROP CONSTRAINT' */",
                length=153, parser_state=0x7f1d2c0ad640, is_com_multi=false, is_next_command=false) at /home/elenst/MDEV-23439/10.2/sql/sql_parse.cc:7733
            #20 0x00005648a74897db in dispatch_command (command=COM_QUERY, thd=0x7f1ce0000d50, packet=0x7f1ce0008b11 "", packet_length=153, is_com_multi=false, is_next_command=false)
                at /home/elenst/MDEV-23439/10.2/sql/sql_parse.cc:1823
            #21 0x00005648a7488258 in do_command (thd=0x7f1ce0000d50) at /home/elenst/MDEV-23439/10.2/sql/sql_parse.cc:1377
            #22 0x00005648a75de491 in do_handle_one_connection (connect=0x5648abc8afe0) at /home/elenst/MDEV-23439/10.2/sql/sql_connect.cc:1336
            #23 0x00005648a75de1fc in handle_one_connection (arg=0x5648abc8afe0) at /home/elenst/MDEV-23439/10.2/sql/sql_connect.cc:1241
            #24 0x00007f1d6852e6db in start_thread (arg=0x7f1d2c0ae700) at pthread_create.c:463
            #25 0x00007f1d67918a3f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
            {noformat}

            A test case for the reference is attached, although I don't know how useful it is for debugging, it is very big in size. Execution time in shm is actually not that bad, it fails for me on 10.2 debug in 2-3 min, but on disk it can take almost an hour.

            Only reproducible with this test case on 10.2, but the failure has been seen on 10.2-10.4. No observations for 10.5.

            rr profile is available.
            {noformat:title=10.2 845e3c9801d}
            mysqld: /home/elenst/MDEV-23439/10.2/storage/innobase/buf/buf0rea.cc:296: ulint buf_read_ahead_random(page_id_t, const page_size_t&, ulint): Assertion `size == space->size' failed.
            200810 10:58:31 [ERROR] mysqld got signal 6 ;

            #3 0x00007f1d678274a2 in __GI___assert_fail (assertion=0x5648a81141e1 "size == space->size", file=0x5648a8114580 "/home/elenst/MDEV-23439/10.2/storage/innobase/buf/buf0rea.cc",
                line=296,
                function=0x5648a8115000 <buf_read_ahead_random(page_id_t, page_size_t const&, unsigned long)::__PRETTY_FUNCTION__> "ulint buf_read_ahead_random(page_id_t, const page_size_t&, ulint)") at assert.c:101
            #4 0x00005648a7ba04e9 in buf_read_ahead_random (page_id=..., page_size=..., inside_ibuf=0) at /home/elenst/MDEV-23439/10.2/storage/innobase/buf/buf0rea.cc:296
            #5 0x00005648a7b7757a in buf_page_get_low (page_id=..., page_size=..., rw_latch=2, guess=0x0, mode=10,
                file=0x5648a8135fe0 "/home/elenst/MDEV-23439/10.2/storage/innobase/fil/fil0fil.cc", line=4497, mtr=0x7f1d2c0a86d0, err=0x0)
                at /home/elenst/MDEV-23439/10.2/storage/innobase/buf/buf0buf.cc:4390
            #6 0x00005648a7b78c49 in buf_page_get_gen (page_id=..., page_size=..., rw_latch=2, guess=0x0, mode=10,
                file=0x5648a8135fe0 "/home/elenst/MDEV-23439/10.2/storage/innobase/fil/fil0fil.cc", line=4497, mtr=0x7f1d2c0a86d0, err=0x0)
                at /home/elenst/MDEV-23439/10.2/storage/innobase/buf/buf0buf.cc:4908
            #7 0x00005648a7c012e0 in fsp_flags_try_adjust (space_id=1918, flags=41) at /home/elenst/MDEV-23439/10.2/storage/innobase/fil/fil0fil.cc:4495
            #8 0x00005648a7c015d0 in fil_space_for_table_exists_in_mem (id=1918, name=0x7f1ce00d2f90 "test/#sql2-20ea-e", table_flags=41)
                at /home/elenst/MDEV-23439/10.2/storage/innobase/fil/fil0fil.cc:4555
            #9 0x00005648a7a4e32d in row_drop_single_table_tablespace (space_id=1918, tablename=0x7f1ce00d2f90 "test/#sql2-20ea-e", filepath=0x7f1ce00f5b50 "./test/#sql2-20ea-e.ibd",
                table_flags=41) at /home/elenst/MDEV-23439/10.2/storage/innobase/row/row0mysql.cc:3253
            #10 0x00005648a7a4f65c in row_drop_table_for_mysql (name=0x7f1d2c0a94f0 "test/#sql2-20ea-e", trx=0x7f1d650a1268, sqlcom=SQLCOM_ALTER_TABLE, create_failed=false, nonatomic=true)
                at /home/elenst/MDEV-23439/10.2/storage/innobase/row/row0mysql.cc:3740
            #11 0x00005648a792a488 in ha_innobase::delete_table (this=0x7f1ce0013590, name=0x7f1d2c0aacf0 "./test/#sql2-20ea-e", sqlcom=SQLCOM_ALTER_TABLE)
                at /home/elenst/MDEV-23439/10.2/storage/innobase/handler/ha_innodb.cc:13304
            #12 0x00005648a7914ff8 in ha_innobase::delete_table (this=0x7f1ce0013590, name=0x7f1d2c0aacf0 "./test/#sql2-20ea-e")
                at /home/elenst/MDEV-23439/10.2/storage/innobase/handler/ha_innodb.cc:13429
            #13 0x00005648a7712d1e in handler::ha_delete_table (this=0x7f1ce0013590, name=0x7f1d2c0aacf0 "./test/#sql2-20ea-e") at /home/elenst/MDEV-23439/10.2/sql/handler.cc:4473
            #14 0x00005648a770d441 in ha_delete_table (thd=0x7f1ce0000d50, table_type=0x5648ab13fa00, path=0x7f1d2c0aacf0 "./test/#sql2-20ea-e", db=0x7f1ce0011b30 "test",
                alias=0x7f1d2c0ab0d0 "#sql2-20ea-e", generate_warning=false) at /home/elenst/MDEV-23439/10.2/sql/handler.cc:2442
            #15 0x00005648a75545ff in quick_rm_table (thd=0x7f1ce0000d50, base=0x5648ab13fa00, db=0x7f1ce0011b30 "test", table_name=0x7f1d2c0ab0d0 "#sql2-20ea-e", flags=3, table_path=0x0)
                at /home/elenst/MDEV-23439/10.2/sql/sql_table.cc:2734
            #16 0x00005648a7567ac8 in mysql_alter_table (thd=0x7f1ce0000d50, new_db=0x7f1ce0011b30 "test", new_name=0x0, create_info=0x7f1d2c0ac2c0, table_list=0x7f1ce0011518,
                alter_info=0x7f1d2c0ac210, order_num=0, order=0x0, ignore=true) at /home/elenst/MDEV-23439/10.2/sql/sql_table.cc:9876
            #17 0x00005648a75e390b in Sql_cmd_alter_table::execute (this=0x7f1ce0011b60, thd=0x7f1ce0000d50) at /home/elenst/MDEV-23439/10.2/sql/sql_alter.cc:333
            #18 0x00005648a7496537 in mysql_execute_command (thd=0x7f1ce0000d50) at /home/elenst/MDEV-23439/10.2/sql/sql_parse.cc:5964
            #19 0x00005648a749b4cf in mysql_parse (thd=0x7f1ce0000d50,
                rawbuf=0x7f1ce0011338 "ALTER /* QNO 122120 CON_ID 15 */ IGNORE TABLE alt_t5 /* 100301 WAIT 1 */ /*!100200 DROP CONSTRAINT IF EXISTS k */ /* COMMENT 'Skipped DROP CONSTRAINT' */",
                length=153, parser_state=0x7f1d2c0ad640, is_com_multi=false, is_next_command=false) at /home/elenst/MDEV-23439/10.2/sql/sql_parse.cc:7733
            #20 0x00005648a74897db in dispatch_command (command=COM_QUERY, thd=0x7f1ce0000d50, packet=0x7f1ce0008b11 "", packet_length=153, is_com_multi=false, is_next_command=false)
                at /home/elenst/MDEV-23439/10.2/sql/sql_parse.cc:1823
            #21 0x00005648a7488258 in do_command (thd=0x7f1ce0000d50) at /home/elenst/MDEV-23439/10.2/sql/sql_parse.cc:1377
            #22 0x00005648a75de491 in do_handle_one_connection (connect=0x5648abc8afe0) at /home/elenst/MDEV-23439/10.2/sql/sql_connect.cc:1336
            #23 0x00005648a75de1fc in handle_one_connection (arg=0x5648abc8afe0) at /home/elenst/MDEV-23439/10.2/sql/sql_connect.cc:1241
            #24 0x00007f1d6852e6db in start_thread (arg=0x7f1d2c0ae700) at pthread_create.c:463
            #25 0x00007f1d67918a3f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
            {noformat}

            A test case for the reference is attached, although I don't know how useful it is for debugging, it is very big in size. Execution time *in shm* is actually not that bad, it fails for me on 10.2 debug in 2-3 min, but on disk it can take almost an hour.

            Only reproducible with this test case on 10.2, but the failure has been seen on 10.2-10.4. No observations for 10.5.

            rr profile is available.
            elenst Elena Stepanova made changes -
            Description {noformat:title=10.2 845e3c9801d}
            mysqld: /home/elenst/MDEV-23439/10.2/storage/innobase/buf/buf0rea.cc:296: ulint buf_read_ahead_random(page_id_t, const page_size_t&, ulint): Assertion `size == space->size' failed.
            200810 10:58:31 [ERROR] mysqld got signal 6 ;

            #3 0x00007f1d678274a2 in __GI___assert_fail (assertion=0x5648a81141e1 "size == space->size", file=0x5648a8114580 "/home/elenst/MDEV-23439/10.2/storage/innobase/buf/buf0rea.cc",
                line=296,
                function=0x5648a8115000 <buf_read_ahead_random(page_id_t, page_size_t const&, unsigned long)::__PRETTY_FUNCTION__> "ulint buf_read_ahead_random(page_id_t, const page_size_t&, ulint)") at assert.c:101
            #4 0x00005648a7ba04e9 in buf_read_ahead_random (page_id=..., page_size=..., inside_ibuf=0) at /home/elenst/MDEV-23439/10.2/storage/innobase/buf/buf0rea.cc:296
            #5 0x00005648a7b7757a in buf_page_get_low (page_id=..., page_size=..., rw_latch=2, guess=0x0, mode=10,
                file=0x5648a8135fe0 "/home/elenst/MDEV-23439/10.2/storage/innobase/fil/fil0fil.cc", line=4497, mtr=0x7f1d2c0a86d0, err=0x0)
                at /home/elenst/MDEV-23439/10.2/storage/innobase/buf/buf0buf.cc:4390
            #6 0x00005648a7b78c49 in buf_page_get_gen (page_id=..., page_size=..., rw_latch=2, guess=0x0, mode=10,
                file=0x5648a8135fe0 "/home/elenst/MDEV-23439/10.2/storage/innobase/fil/fil0fil.cc", line=4497, mtr=0x7f1d2c0a86d0, err=0x0)
                at /home/elenst/MDEV-23439/10.2/storage/innobase/buf/buf0buf.cc:4908
            #7 0x00005648a7c012e0 in fsp_flags_try_adjust (space_id=1918, flags=41) at /home/elenst/MDEV-23439/10.2/storage/innobase/fil/fil0fil.cc:4495
            #8 0x00005648a7c015d0 in fil_space_for_table_exists_in_mem (id=1918, name=0x7f1ce00d2f90 "test/#sql2-20ea-e", table_flags=41)
                at /home/elenst/MDEV-23439/10.2/storage/innobase/fil/fil0fil.cc:4555
            #9 0x00005648a7a4e32d in row_drop_single_table_tablespace (space_id=1918, tablename=0x7f1ce00d2f90 "test/#sql2-20ea-e", filepath=0x7f1ce00f5b50 "./test/#sql2-20ea-e.ibd",
                table_flags=41) at /home/elenst/MDEV-23439/10.2/storage/innobase/row/row0mysql.cc:3253
            #10 0x00005648a7a4f65c in row_drop_table_for_mysql (name=0x7f1d2c0a94f0 "test/#sql2-20ea-e", trx=0x7f1d650a1268, sqlcom=SQLCOM_ALTER_TABLE, create_failed=false, nonatomic=true)
                at /home/elenst/MDEV-23439/10.2/storage/innobase/row/row0mysql.cc:3740
            #11 0x00005648a792a488 in ha_innobase::delete_table (this=0x7f1ce0013590, name=0x7f1d2c0aacf0 "./test/#sql2-20ea-e", sqlcom=SQLCOM_ALTER_TABLE)
                at /home/elenst/MDEV-23439/10.2/storage/innobase/handler/ha_innodb.cc:13304
            #12 0x00005648a7914ff8 in ha_innobase::delete_table (this=0x7f1ce0013590, name=0x7f1d2c0aacf0 "./test/#sql2-20ea-e")
                at /home/elenst/MDEV-23439/10.2/storage/innobase/handler/ha_innodb.cc:13429
            #13 0x00005648a7712d1e in handler::ha_delete_table (this=0x7f1ce0013590, name=0x7f1d2c0aacf0 "./test/#sql2-20ea-e") at /home/elenst/MDEV-23439/10.2/sql/handler.cc:4473
            #14 0x00005648a770d441 in ha_delete_table (thd=0x7f1ce0000d50, table_type=0x5648ab13fa00, path=0x7f1d2c0aacf0 "./test/#sql2-20ea-e", db=0x7f1ce0011b30 "test",
                alias=0x7f1d2c0ab0d0 "#sql2-20ea-e", generate_warning=false) at /home/elenst/MDEV-23439/10.2/sql/handler.cc:2442
            #15 0x00005648a75545ff in quick_rm_table (thd=0x7f1ce0000d50, base=0x5648ab13fa00, db=0x7f1ce0011b30 "test", table_name=0x7f1d2c0ab0d0 "#sql2-20ea-e", flags=3, table_path=0x0)
                at /home/elenst/MDEV-23439/10.2/sql/sql_table.cc:2734
            #16 0x00005648a7567ac8 in mysql_alter_table (thd=0x7f1ce0000d50, new_db=0x7f1ce0011b30 "test", new_name=0x0, create_info=0x7f1d2c0ac2c0, table_list=0x7f1ce0011518,
                alter_info=0x7f1d2c0ac210, order_num=0, order=0x0, ignore=true) at /home/elenst/MDEV-23439/10.2/sql/sql_table.cc:9876
            #17 0x00005648a75e390b in Sql_cmd_alter_table::execute (this=0x7f1ce0011b60, thd=0x7f1ce0000d50) at /home/elenst/MDEV-23439/10.2/sql/sql_alter.cc:333
            #18 0x00005648a7496537 in mysql_execute_command (thd=0x7f1ce0000d50) at /home/elenst/MDEV-23439/10.2/sql/sql_parse.cc:5964
            #19 0x00005648a749b4cf in mysql_parse (thd=0x7f1ce0000d50,
                rawbuf=0x7f1ce0011338 "ALTER /* QNO 122120 CON_ID 15 */ IGNORE TABLE alt_t5 /* 100301 WAIT 1 */ /*!100200 DROP CONSTRAINT IF EXISTS k */ /* COMMENT 'Skipped DROP CONSTRAINT' */",
                length=153, parser_state=0x7f1d2c0ad640, is_com_multi=false, is_next_command=false) at /home/elenst/MDEV-23439/10.2/sql/sql_parse.cc:7733
            #20 0x00005648a74897db in dispatch_command (command=COM_QUERY, thd=0x7f1ce0000d50, packet=0x7f1ce0008b11 "", packet_length=153, is_com_multi=false, is_next_command=false)
                at /home/elenst/MDEV-23439/10.2/sql/sql_parse.cc:1823
            #21 0x00005648a7488258 in do_command (thd=0x7f1ce0000d50) at /home/elenst/MDEV-23439/10.2/sql/sql_parse.cc:1377
            #22 0x00005648a75de491 in do_handle_one_connection (connect=0x5648abc8afe0) at /home/elenst/MDEV-23439/10.2/sql/sql_connect.cc:1336
            #23 0x00005648a75de1fc in handle_one_connection (arg=0x5648abc8afe0) at /home/elenst/MDEV-23439/10.2/sql/sql_connect.cc:1241
            #24 0x00007f1d6852e6db in start_thread (arg=0x7f1d2c0ae700) at pthread_create.c:463
            #25 0x00007f1d67918a3f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
            {noformat}

            A test case for the reference is attached, although I don't know how useful it is for debugging, it is very big in size. Execution time *in shm* is actually not that bad, it fails for me on 10.2 debug in 2-3 min, but on disk it can take almost an hour.

            Only reproducible with this test case on 10.2, but the failure has been seen on 10.2-10.4. No observations for 10.5.

            rr profile is available.
            {noformat:title=10.2 845e3c9801d}
            mysqld: /home/elenst/MDEV-23439/10.2/storage/innobase/buf/buf0rea.cc:296: ulint buf_read_ahead_random(page_id_t, const page_size_t&, ulint): Assertion `size == space->size' failed.
            200810 10:58:31 [ERROR] mysqld got signal 6 ;

            #3 0x00007f1d678274a2 in __GI___assert_fail (assertion=0x5648a81141e1 "size == space->size", file=0x5648a8114580 "/home/elenst/MDEV-23439/10.2/storage/innobase/buf/buf0rea.cc",
                line=296,
                function=0x5648a8115000 <buf_read_ahead_random(page_id_t, page_size_t const&, unsigned long)::__PRETTY_FUNCTION__> "ulint buf_read_ahead_random(page_id_t, const page_size_t&, ulint)") at assert.c:101
            #4 0x00005648a7ba04e9 in buf_read_ahead_random (page_id=..., page_size=..., inside_ibuf=0) at /home/elenst/MDEV-23439/10.2/storage/innobase/buf/buf0rea.cc:296
            #5 0x00005648a7b7757a in buf_page_get_low (page_id=..., page_size=..., rw_latch=2, guess=0x0, mode=10,
                file=0x5648a8135fe0 "/home/elenst/MDEV-23439/10.2/storage/innobase/fil/fil0fil.cc", line=4497, mtr=0x7f1d2c0a86d0, err=0x0)
                at /home/elenst/MDEV-23439/10.2/storage/innobase/buf/buf0buf.cc:4390
            #6 0x00005648a7b78c49 in buf_page_get_gen (page_id=..., page_size=..., rw_latch=2, guess=0x0, mode=10,
                file=0x5648a8135fe0 "/home/elenst/MDEV-23439/10.2/storage/innobase/fil/fil0fil.cc", line=4497, mtr=0x7f1d2c0a86d0, err=0x0)
                at /home/elenst/MDEV-23439/10.2/storage/innobase/buf/buf0buf.cc:4908
            #7 0x00005648a7c012e0 in fsp_flags_try_adjust (space_id=1918, flags=41) at /home/elenst/MDEV-23439/10.2/storage/innobase/fil/fil0fil.cc:4495
            #8 0x00005648a7c015d0 in fil_space_for_table_exists_in_mem (id=1918, name=0x7f1ce00d2f90 "test/#sql2-20ea-e", table_flags=41)
                at /home/elenst/MDEV-23439/10.2/storage/innobase/fil/fil0fil.cc:4555
            #9 0x00005648a7a4e32d in row_drop_single_table_tablespace (space_id=1918, tablename=0x7f1ce00d2f90 "test/#sql2-20ea-e", filepath=0x7f1ce00f5b50 "./test/#sql2-20ea-e.ibd",
                table_flags=41) at /home/elenst/MDEV-23439/10.2/storage/innobase/row/row0mysql.cc:3253
            #10 0x00005648a7a4f65c in row_drop_table_for_mysql (name=0x7f1d2c0a94f0 "test/#sql2-20ea-e", trx=0x7f1d650a1268, sqlcom=SQLCOM_ALTER_TABLE, create_failed=false, nonatomic=true)
                at /home/elenst/MDEV-23439/10.2/storage/innobase/row/row0mysql.cc:3740
            #11 0x00005648a792a488 in ha_innobase::delete_table (this=0x7f1ce0013590, name=0x7f1d2c0aacf0 "./test/#sql2-20ea-e", sqlcom=SQLCOM_ALTER_TABLE)
                at /home/elenst/MDEV-23439/10.2/storage/innobase/handler/ha_innodb.cc:13304
            #12 0x00005648a7914ff8 in ha_innobase::delete_table (this=0x7f1ce0013590, name=0x7f1d2c0aacf0 "./test/#sql2-20ea-e")
                at /home/elenst/MDEV-23439/10.2/storage/innobase/handler/ha_innodb.cc:13429
            #13 0x00005648a7712d1e in handler::ha_delete_table (this=0x7f1ce0013590, name=0x7f1d2c0aacf0 "./test/#sql2-20ea-e") at /home/elenst/MDEV-23439/10.2/sql/handler.cc:4473
            #14 0x00005648a770d441 in ha_delete_table (thd=0x7f1ce0000d50, table_type=0x5648ab13fa00, path=0x7f1d2c0aacf0 "./test/#sql2-20ea-e", db=0x7f1ce0011b30 "test",
                alias=0x7f1d2c0ab0d0 "#sql2-20ea-e", generate_warning=false) at /home/elenst/MDEV-23439/10.2/sql/handler.cc:2442
            #15 0x00005648a75545ff in quick_rm_table (thd=0x7f1ce0000d50, base=0x5648ab13fa00, db=0x7f1ce0011b30 "test", table_name=0x7f1d2c0ab0d0 "#sql2-20ea-e", flags=3, table_path=0x0)
                at /home/elenst/MDEV-23439/10.2/sql/sql_table.cc:2734
            #16 0x00005648a7567ac8 in mysql_alter_table (thd=0x7f1ce0000d50, new_db=0x7f1ce0011b30 "test", new_name=0x0, create_info=0x7f1d2c0ac2c0, table_list=0x7f1ce0011518,
                alter_info=0x7f1d2c0ac210, order_num=0, order=0x0, ignore=true) at /home/elenst/MDEV-23439/10.2/sql/sql_table.cc:9876
            #17 0x00005648a75e390b in Sql_cmd_alter_table::execute (this=0x7f1ce0011b60, thd=0x7f1ce0000d50) at /home/elenst/MDEV-23439/10.2/sql/sql_alter.cc:333
            #18 0x00005648a7496537 in mysql_execute_command (thd=0x7f1ce0000d50) at /home/elenst/MDEV-23439/10.2/sql/sql_parse.cc:5964
            #19 0x00005648a749b4cf in mysql_parse (thd=0x7f1ce0000d50,
                rawbuf=0x7f1ce0011338 "ALTER /* QNO 122120 CON_ID 15 */ IGNORE TABLE alt_t5 /* 100301 WAIT 1 */ /*!100200 DROP CONSTRAINT IF EXISTS k */ /* COMMENT 'Skipped DROP CONSTRAINT' */",
                length=153, parser_state=0x7f1d2c0ad640, is_com_multi=false, is_next_command=false) at /home/elenst/MDEV-23439/10.2/sql/sql_parse.cc:7733
            #20 0x00005648a74897db in dispatch_command (command=COM_QUERY, thd=0x7f1ce0000d50, packet=0x7f1ce0008b11 "", packet_length=153, is_com_multi=false, is_next_command=false)
                at /home/elenst/MDEV-23439/10.2/sql/sql_parse.cc:1823
            #21 0x00005648a7488258 in do_command (thd=0x7f1ce0000d50) at /home/elenst/MDEV-23439/10.2/sql/sql_parse.cc:1377
            #22 0x00005648a75de491 in do_handle_one_connection (connect=0x5648abc8afe0) at /home/elenst/MDEV-23439/10.2/sql/sql_connect.cc:1336
            #23 0x00005648a75de1fc in handle_one_connection (arg=0x5648abc8afe0) at /home/elenst/MDEV-23439/10.2/sql/sql_connect.cc:1241
            #24 0x00007f1d6852e6db in start_thread (arg=0x7f1d2c0ae700) at pthread_create.c:463
            #25 0x00007f1d67918a3f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
            {noformat}

            A test case for the reference is attached, although I don't know how useful it is for debugging, it is very big in size. Execution time *in shm* is actually not that bad, it fails for me on 10.2 debug in 2-3 min, but on disk it can take almost an hour. The test case is to be run with
            {noformat}
            --mem --mysqld=--innodb --mysqld=--default-storage-engine=InnoDB --mysqld=--partition --mysqld=--loose-innodb-stats-persistent=on --mysqld=--character-set-server=utf8 --mysqld=--max-allowed-packet=128M --mysqld=--innodb-buffer-pool-size=128M --mysqld=--innodb-log-file-size=48M --mysqld=--log_bin_trust_function_creators=OFF --mysqld=--key_buffer_size=128M --mysqld=--performance-schema=OFF --mysqld=--log_output=FILE --mysqld=--max-statement-time=20 --mysqld=--lock-wait-timeout=10 --mysqld=--innodb-lock-wait-timeout=5 --mysqld=--loose-max-statement-time=10 --mysqld=--innodb-lock-wait-timeout=3 --mysqld=--lock-wait-timeout=5
            {noformat}

            Only reproducible with this test case on 10.2, but the failure has been seen on 10.2-10.4. No observations for 10.5.

            rr profile is available.
            elenst Elena Stepanova made changes -
            Description {noformat:title=10.2 845e3c9801d}
            mysqld: /home/elenst/MDEV-23439/10.2/storage/innobase/buf/buf0rea.cc:296: ulint buf_read_ahead_random(page_id_t, const page_size_t&, ulint): Assertion `size == space->size' failed.
            200810 10:58:31 [ERROR] mysqld got signal 6 ;

            #3 0x00007f1d678274a2 in __GI___assert_fail (assertion=0x5648a81141e1 "size == space->size", file=0x5648a8114580 "/home/elenst/MDEV-23439/10.2/storage/innobase/buf/buf0rea.cc",
                line=296,
                function=0x5648a8115000 <buf_read_ahead_random(page_id_t, page_size_t const&, unsigned long)::__PRETTY_FUNCTION__> "ulint buf_read_ahead_random(page_id_t, const page_size_t&, ulint)") at assert.c:101
            #4 0x00005648a7ba04e9 in buf_read_ahead_random (page_id=..., page_size=..., inside_ibuf=0) at /home/elenst/MDEV-23439/10.2/storage/innobase/buf/buf0rea.cc:296
            #5 0x00005648a7b7757a in buf_page_get_low (page_id=..., page_size=..., rw_latch=2, guess=0x0, mode=10,
                file=0x5648a8135fe0 "/home/elenst/MDEV-23439/10.2/storage/innobase/fil/fil0fil.cc", line=4497, mtr=0x7f1d2c0a86d0, err=0x0)
                at /home/elenst/MDEV-23439/10.2/storage/innobase/buf/buf0buf.cc:4390
            #6 0x00005648a7b78c49 in buf_page_get_gen (page_id=..., page_size=..., rw_latch=2, guess=0x0, mode=10,
                file=0x5648a8135fe0 "/home/elenst/MDEV-23439/10.2/storage/innobase/fil/fil0fil.cc", line=4497, mtr=0x7f1d2c0a86d0, err=0x0)
                at /home/elenst/MDEV-23439/10.2/storage/innobase/buf/buf0buf.cc:4908
            #7 0x00005648a7c012e0 in fsp_flags_try_adjust (space_id=1918, flags=41) at /home/elenst/MDEV-23439/10.2/storage/innobase/fil/fil0fil.cc:4495
            #8 0x00005648a7c015d0 in fil_space_for_table_exists_in_mem (id=1918, name=0x7f1ce00d2f90 "test/#sql2-20ea-e", table_flags=41)
                at /home/elenst/MDEV-23439/10.2/storage/innobase/fil/fil0fil.cc:4555
            #9 0x00005648a7a4e32d in row_drop_single_table_tablespace (space_id=1918, tablename=0x7f1ce00d2f90 "test/#sql2-20ea-e", filepath=0x7f1ce00f5b50 "./test/#sql2-20ea-e.ibd",
                table_flags=41) at /home/elenst/MDEV-23439/10.2/storage/innobase/row/row0mysql.cc:3253
            #10 0x00005648a7a4f65c in row_drop_table_for_mysql (name=0x7f1d2c0a94f0 "test/#sql2-20ea-e", trx=0x7f1d650a1268, sqlcom=SQLCOM_ALTER_TABLE, create_failed=false, nonatomic=true)
                at /home/elenst/MDEV-23439/10.2/storage/innobase/row/row0mysql.cc:3740
            #11 0x00005648a792a488 in ha_innobase::delete_table (this=0x7f1ce0013590, name=0x7f1d2c0aacf0 "./test/#sql2-20ea-e", sqlcom=SQLCOM_ALTER_TABLE)
                at /home/elenst/MDEV-23439/10.2/storage/innobase/handler/ha_innodb.cc:13304
            #12 0x00005648a7914ff8 in ha_innobase::delete_table (this=0x7f1ce0013590, name=0x7f1d2c0aacf0 "./test/#sql2-20ea-e")
                at /home/elenst/MDEV-23439/10.2/storage/innobase/handler/ha_innodb.cc:13429
            #13 0x00005648a7712d1e in handler::ha_delete_table (this=0x7f1ce0013590, name=0x7f1d2c0aacf0 "./test/#sql2-20ea-e") at /home/elenst/MDEV-23439/10.2/sql/handler.cc:4473
            #14 0x00005648a770d441 in ha_delete_table (thd=0x7f1ce0000d50, table_type=0x5648ab13fa00, path=0x7f1d2c0aacf0 "./test/#sql2-20ea-e", db=0x7f1ce0011b30 "test",
                alias=0x7f1d2c0ab0d0 "#sql2-20ea-e", generate_warning=false) at /home/elenst/MDEV-23439/10.2/sql/handler.cc:2442
            #15 0x00005648a75545ff in quick_rm_table (thd=0x7f1ce0000d50, base=0x5648ab13fa00, db=0x7f1ce0011b30 "test", table_name=0x7f1d2c0ab0d0 "#sql2-20ea-e", flags=3, table_path=0x0)
                at /home/elenst/MDEV-23439/10.2/sql/sql_table.cc:2734
            #16 0x00005648a7567ac8 in mysql_alter_table (thd=0x7f1ce0000d50, new_db=0x7f1ce0011b30 "test", new_name=0x0, create_info=0x7f1d2c0ac2c0, table_list=0x7f1ce0011518,
                alter_info=0x7f1d2c0ac210, order_num=0, order=0x0, ignore=true) at /home/elenst/MDEV-23439/10.2/sql/sql_table.cc:9876
            #17 0x00005648a75e390b in Sql_cmd_alter_table::execute (this=0x7f1ce0011b60, thd=0x7f1ce0000d50) at /home/elenst/MDEV-23439/10.2/sql/sql_alter.cc:333
            #18 0x00005648a7496537 in mysql_execute_command (thd=0x7f1ce0000d50) at /home/elenst/MDEV-23439/10.2/sql/sql_parse.cc:5964
            #19 0x00005648a749b4cf in mysql_parse (thd=0x7f1ce0000d50,
                rawbuf=0x7f1ce0011338 "ALTER /* QNO 122120 CON_ID 15 */ IGNORE TABLE alt_t5 /* 100301 WAIT 1 */ /*!100200 DROP CONSTRAINT IF EXISTS k */ /* COMMENT 'Skipped DROP CONSTRAINT' */",
                length=153, parser_state=0x7f1d2c0ad640, is_com_multi=false, is_next_command=false) at /home/elenst/MDEV-23439/10.2/sql/sql_parse.cc:7733
            #20 0x00005648a74897db in dispatch_command (command=COM_QUERY, thd=0x7f1ce0000d50, packet=0x7f1ce0008b11 "", packet_length=153, is_com_multi=false, is_next_command=false)
                at /home/elenst/MDEV-23439/10.2/sql/sql_parse.cc:1823
            #21 0x00005648a7488258 in do_command (thd=0x7f1ce0000d50) at /home/elenst/MDEV-23439/10.2/sql/sql_parse.cc:1377
            #22 0x00005648a75de491 in do_handle_one_connection (connect=0x5648abc8afe0) at /home/elenst/MDEV-23439/10.2/sql/sql_connect.cc:1336
            #23 0x00005648a75de1fc in handle_one_connection (arg=0x5648abc8afe0) at /home/elenst/MDEV-23439/10.2/sql/sql_connect.cc:1241
            #24 0x00007f1d6852e6db in start_thread (arg=0x7f1d2c0ae700) at pthread_create.c:463
            #25 0x00007f1d67918a3f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
            {noformat}

            A test case for the reference is attached, although I don't know how useful it is for debugging, it is very big in size. Execution time *in shm* is actually not that bad, it fails for me on 10.2 debug in 2-3 min, but on disk it can take almost an hour. The test case is to be run with
            {noformat}
            --mem --mysqld=--innodb --mysqld=--default-storage-engine=InnoDB --mysqld=--partition --mysqld=--loose-innodb-stats-persistent=on --mysqld=--character-set-server=utf8 --mysqld=--max-allowed-packet=128M --mysqld=--innodb-buffer-pool-size=128M --mysqld=--innodb-log-file-size=48M --mysqld=--log_bin_trust_function_creators=OFF --mysqld=--key_buffer_size=128M --mysqld=--performance-schema=OFF --mysqld=--log_output=FILE --mysqld=--max-statement-time=20 --mysqld=--lock-wait-timeout=10 --mysqld=--innodb-lock-wait-timeout=5 --mysqld=--loose-max-statement-time=10 --mysqld=--innodb-lock-wait-timeout=3 --mysqld=--lock-wait-timeout=5
            {noformat}

            Only reproducible with this test case on 10.2, but the failure has been seen on 10.2-10.4. No observations for 10.5.

            rr profile is available.
            {noformat:title=10.2 845e3c9801d}
            mysqld: /home/elenst/MDEV-23439/10.2/storage/innobase/buf/buf0rea.cc:296: ulint buf_read_ahead_random(page_id_t, const page_size_t&, ulint): Assertion `size == space->size' failed.
            200810 10:58:31 [ERROR] mysqld got signal 6 ;

            #3 0x00007f1d678274a2 in __GI___assert_fail (assertion=0x5648a81141e1 "size == space->size", file=0x5648a8114580 "/home/elenst/MDEV-23439/10.2/storage/innobase/buf/buf0rea.cc",
                line=296,
                function=0x5648a8115000 <buf_read_ahead_random(page_id_t, page_size_t const&, unsigned long)::__PRETTY_FUNCTION__> "ulint buf_read_ahead_random(page_id_t, const page_size_t&, ulint)") at assert.c:101
            #4 0x00005648a7ba04e9 in buf_read_ahead_random (page_id=..., page_size=..., inside_ibuf=0) at /home/elenst/MDEV-23439/10.2/storage/innobase/buf/buf0rea.cc:296
            #5 0x00005648a7b7757a in buf_page_get_low (page_id=..., page_size=..., rw_latch=2, guess=0x0, mode=10,
                file=0x5648a8135fe0 "/home/elenst/MDEV-23439/10.2/storage/innobase/fil/fil0fil.cc", line=4497, mtr=0x7f1d2c0a86d0, err=0x0)
                at /home/elenst/MDEV-23439/10.2/storage/innobase/buf/buf0buf.cc:4390
            #6 0x00005648a7b78c49 in buf_page_get_gen (page_id=..., page_size=..., rw_latch=2, guess=0x0, mode=10,
                file=0x5648a8135fe0 "/home/elenst/MDEV-23439/10.2/storage/innobase/fil/fil0fil.cc", line=4497, mtr=0x7f1d2c0a86d0, err=0x0)
                at /home/elenst/MDEV-23439/10.2/storage/innobase/buf/buf0buf.cc:4908
            #7 0x00005648a7c012e0 in fsp_flags_try_adjust (space_id=1918, flags=41) at /home/elenst/MDEV-23439/10.2/storage/innobase/fil/fil0fil.cc:4495
            #8 0x00005648a7c015d0 in fil_space_for_table_exists_in_mem (id=1918, name=0x7f1ce00d2f90 "test/#sql2-20ea-e", table_flags=41)
                at /home/elenst/MDEV-23439/10.2/storage/innobase/fil/fil0fil.cc:4555
            #9 0x00005648a7a4e32d in row_drop_single_table_tablespace (space_id=1918, tablename=0x7f1ce00d2f90 "test/#sql2-20ea-e", filepath=0x7f1ce00f5b50 "./test/#sql2-20ea-e.ibd",
                table_flags=41) at /home/elenst/MDEV-23439/10.2/storage/innobase/row/row0mysql.cc:3253
            #10 0x00005648a7a4f65c in row_drop_table_for_mysql (name=0x7f1d2c0a94f0 "test/#sql2-20ea-e", trx=0x7f1d650a1268, sqlcom=SQLCOM_ALTER_TABLE, create_failed=false, nonatomic=true)
                at /home/elenst/MDEV-23439/10.2/storage/innobase/row/row0mysql.cc:3740
            #11 0x00005648a792a488 in ha_innobase::delete_table (this=0x7f1ce0013590, name=0x7f1d2c0aacf0 "./test/#sql2-20ea-e", sqlcom=SQLCOM_ALTER_TABLE)
                at /home/elenst/MDEV-23439/10.2/storage/innobase/handler/ha_innodb.cc:13304
            #12 0x00005648a7914ff8 in ha_innobase::delete_table (this=0x7f1ce0013590, name=0x7f1d2c0aacf0 "./test/#sql2-20ea-e")
                at /home/elenst/MDEV-23439/10.2/storage/innobase/handler/ha_innodb.cc:13429
            #13 0x00005648a7712d1e in handler::ha_delete_table (this=0x7f1ce0013590, name=0x7f1d2c0aacf0 "./test/#sql2-20ea-e") at /home/elenst/MDEV-23439/10.2/sql/handler.cc:4473
            #14 0x00005648a770d441 in ha_delete_table (thd=0x7f1ce0000d50, table_type=0x5648ab13fa00, path=0x7f1d2c0aacf0 "./test/#sql2-20ea-e", db=0x7f1ce0011b30 "test",
                alias=0x7f1d2c0ab0d0 "#sql2-20ea-e", generate_warning=false) at /home/elenst/MDEV-23439/10.2/sql/handler.cc:2442
            #15 0x00005648a75545ff in quick_rm_table (thd=0x7f1ce0000d50, base=0x5648ab13fa00, db=0x7f1ce0011b30 "test", table_name=0x7f1d2c0ab0d0 "#sql2-20ea-e", flags=3, table_path=0x0)
                at /home/elenst/MDEV-23439/10.2/sql/sql_table.cc:2734
            #16 0x00005648a7567ac8 in mysql_alter_table (thd=0x7f1ce0000d50, new_db=0x7f1ce0011b30 "test", new_name=0x0, create_info=0x7f1d2c0ac2c0, table_list=0x7f1ce0011518,
                alter_info=0x7f1d2c0ac210, order_num=0, order=0x0, ignore=true) at /home/elenst/MDEV-23439/10.2/sql/sql_table.cc:9876
            #17 0x00005648a75e390b in Sql_cmd_alter_table::execute (this=0x7f1ce0011b60, thd=0x7f1ce0000d50) at /home/elenst/MDEV-23439/10.2/sql/sql_alter.cc:333
            #18 0x00005648a7496537 in mysql_execute_command (thd=0x7f1ce0000d50) at /home/elenst/MDEV-23439/10.2/sql/sql_parse.cc:5964
            #19 0x00005648a749b4cf in mysql_parse (thd=0x7f1ce0000d50,
                rawbuf=0x7f1ce0011338 "ALTER /* QNO 122120 CON_ID 15 */ IGNORE TABLE alt_t5 /* 100301 WAIT 1 */ /*!100200 DROP CONSTRAINT IF EXISTS k */ /* COMMENT 'Skipped DROP CONSTRAINT' */",
                length=153, parser_state=0x7f1d2c0ad640, is_com_multi=false, is_next_command=false) at /home/elenst/MDEV-23439/10.2/sql/sql_parse.cc:7733
            #20 0x00005648a74897db in dispatch_command (command=COM_QUERY, thd=0x7f1ce0000d50, packet=0x7f1ce0008b11 "", packet_length=153, is_com_multi=false, is_next_command=false)
                at /home/elenst/MDEV-23439/10.2/sql/sql_parse.cc:1823
            #21 0x00005648a7488258 in do_command (thd=0x7f1ce0000d50) at /home/elenst/MDEV-23439/10.2/sql/sql_parse.cc:1377
            #22 0x00005648a75de491 in do_handle_one_connection (connect=0x5648abc8afe0) at /home/elenst/MDEV-23439/10.2/sql/sql_connect.cc:1336
            #23 0x00005648a75de1fc in handle_one_connection (arg=0x5648abc8afe0) at /home/elenst/MDEV-23439/10.2/sql/sql_connect.cc:1241
            #24 0x00007f1d6852e6db in start_thread (arg=0x7f1d2c0ae700) at pthread_create.c:463
            #25 0x00007f1d67918a3f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
            {noformat}

            A test case for the reference is attached, although I don't know how useful it is for debugging, it is very big in size. Execution time *in shm* is actually not that bad, it fails for me on 10.2 debug in 2-3 min, but on disk it can take almost an hour. The test case is to be run with
            {noformat}
            --mem --mysqld=--innodb --mysqld=--default-storage-engine=InnoDB --mysqld=--partition --mysqld=--loose-innodb-stats-persistent=on --mysqld=--character-set-server=utf8 --mysqld=--max-allowed-packet=128M --mysqld=--innodb-buffer-pool-size=128M --mysqld=--innodb-log-file-size=48M --mysqld=--log_bin_trust_function_creators=OFF --mysqld=--key_buffer_size=128M --mysqld=--performance-schema=OFF --mysqld=--log_output=FILE --mysqld=--max-statement-time=20 --mysqld=--loose-max-statement-time=10 --mysqld=--innodb-lock-wait-timeout=3 --mysqld=--lock-wait-timeout=5
            {noformat}
            (not all options are important, but these has been used successfully).

            Only reproducible with this test case on 10.2, but the failure has been seen on 10.2-10.4. No observations for 10.5.

            rr profile is available.
            marko Marko Mäkelä made changes -
            Labels rr-profile rr-profile-analyzed
            marko Marko Mäkelä made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            marko Marko Mäkelä made changes -
            marko Marko Mäkelä made changes -
            Labels rr-profile-analyzed debug not-10.5 rr-profile-analyzed
            marko Marko Mäkelä made changes -
            issue.field.resolutiondate 2020-08-12 10:24:21.0 2020-08-12 10:24:21.984
            marko Marko Mäkelä made changes -
            Fix Version/s 10.2.34 [ 24505 ]
            Fix Version/s 10.3.25 [ 24506 ]
            Fix Version/s 10.4.15 [ 24507 ]
            Fix Version/s 10.2 [ 14601 ]
            Fix Version/s 10.3 [ 22126 ]
            Fix Version/s 10.4 [ 22408 ]
            Resolution Fixed [ 1 ]
            Status In Progress [ 3 ] Closed [ 6 ]
            ralf.gebhardt Ralf Gebhardt made changes -
            Fix Version/s 10.4.16 [ 25020 ]
            ralf.gebhardt Ralf Gebhardt made changes -
            Fix Version/s 10.4.15 [ 24507 ]
            ralf.gebhardt Ralf Gebhardt made changes -
            Fix Version/s 10.3.26 [ 25021 ]
            ralf.gebhardt Ralf Gebhardt made changes -
            Fix Version/s 10.3.25 [ 24506 ]
            ralf.gebhardt Ralf Gebhardt made changes -
            Fix Version/s 10.2.35 [ 25022 ]
            ralf.gebhardt Ralf Gebhardt made changes -
            Fix Version/s 10.2.34 [ 24505 ]
            serg Sergei Golubchik made changes -
            Workflow MariaDB v3 [ 112162 ] MariaDB v4 [ 158221 ]

            People

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