Uploaded image for project: 'Percona Server for MySQL'
  1. Percona Server for MySQL
  2. PS-7168

Determine if file per tablespace using table flags to prevent assertion

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: 8.0.19-10
    • Fix Version/s: 8.0.20-11
    • Component/s: None
    • Labels:

      Description

      mysql> CREATE DATABASE test;
      Query OK, 1 row affected (0.01 sec)
      
      mysql> USE test;
      Database changed
      mysql> set global innodb_file_per_table=off;
      Query OK, 0 rows affected (0.01 sec)
      
      mysql> CREATE TABLE t1(ol_o_id int,ol_d_id int,ol_w_id int,ol_number int,ol_tmp int,KEY (ol_w_id,ol_d_id,ol_o_id,ol_number)) PARTITION BY HASH (ol_w_id);
      Query OK, 0 rows affected (0.03 sec)
      
      mysql> ALTER TABLE t1 ADD COLUMN v2 CHAR(1),ALGORITHM=INSTANT;
      Query OK, 0 rows affected (0.07 sec)
      Records: 0  Duplicates: 0  Warnings: 0
      
      mysql> alter table t1 encryption='n';
      ERROR 2013 (HY000): Lost connection to MySQL server during query
      
      root@bionic:~# /vagrant/old_vc.sh
      +------------------+
      | @@INNODB_VERSION |
      +------------------+
      | 8.0.20-11        |
      +------------------+
      +-----------+
      | @@VERSION |
      +-----------+
      | 8.0.20-11 |
      +-----------+
      +------------------------------------------------------------+
      | @@VERSION_COMMENT                                          |
      +------------------------------------------------------------+
      | Percona Server (GPL), Release '11', Revision '91928779178' |
      +------------------------------------------------------------+
      

      gdb from debug build:

      Core was generated by `/sdc/PS090720-percona-server-8.0.20-11-linux-x86_64-debug/bin/mysqld --no-defau'.
      Program terminated with signal 6, Aborted.
      #0  0x00007f5f7acd1aa1 in __pthread_kill (threadid=<optimized out>, signo=6) at ../nptl/sysdeps/unix/sysv/linux/pthread_kill.c:59
      59        val = INTERNAL_SYSCALL (tgkill, err, 3, THREAD_GETMEM (THREAD_SELF, pid),
      (gdb) bt
      +bt
      #0  0x00007f5f7acd1aa1 in __pthread_kill (threadid=<optimized out>, signo=6) at ../nptl/sysdeps/unix/sysv/linux/pthread_kill.c:59
      #1  0x0000000004b46388 in my_write_core (sig=6) at /home/hrvoje/sdc/release-8.0.20-11_dbg/mysys/stacktrace.cc:308
      #2  0x0000000003a57c94 in handle_fatal_signal (sig=6) at /home/hrvoje/sdc/release-8.0.20-11_dbg/sql/signal_handler.cc:174
      #3  <signal handler called>
      #4  0x00007f5f78b17387 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:55
      #5  0x00007f5f78b18a78 in __GI_abort () at abort.c:90
      #6  0x00007f5f78b101a6 in __assert_fail_base (fmt=0x7f5f78c6bce0 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x6b62ce9 "ctx->trx", file=file@entry=0x6b5fd60 "/home/hrvoje/sdc/release-8.0.20-11_dbg/storage/innobase/handler/handler0alter.cc", line=line@entry=6147, function=function@entry=0x6b65360 <bool ha_innobase::inplace_alter_table_impl<dd::Partition>(TABLE*, Alter_inplace_info*, dd::Partition const*, dd::Partition*)::__PRETTY_FUNCTION__> "bool ha_innobase::inplace_alter_table_impl(TABLE*, Alter_inplace_info*, const Table*, Table*) [with Table = dd::Partition]") at assert.c:92
      #7  0x00007f5f78b10252 in __GI___assert_fail (assertion=0x6b62ce9 "ctx->trx", file=0x6b5fd60 "/home/hrvoje/sdc/release-8.0.20-11_dbg/storage/innobase/handler/handler0alter.cc", line=6147, function=0x6b65360 <bool ha_innobase::inplace_alter_table_impl<dd::Partition>(TABLE*, Alter_inplace_info*, dd::Partition const*, dd::Partition*)::__PRETTY_FUNCTION__> "bool ha_innobase::inplace_alter_table_impl(TABLE*, Alter_inplace_info*, const Table*, Table*) [with Table = dd::Partition]") at assert.c:101
      #8  0x0000000004cfdeaf in ha_innobase::inplace_alter_table_impl<dd::Partition> (this=0x7f5f1e24e028, altered_table=0x7f5f1e0ba020, ha_alter_info=0x7f5f7746c7d0, old_dd_tab=0x7f5f1e158e20, new_dd_tab=0x7f5f1e3ac220) at /home/hrvoje/sdc/release-8.0.20-11_dbg/storage/innobase/handler/handler0alter.cc:6147
      #9  0x0000000004cdf303 in ha_innopart::inplace_alter_table (this=0x7f5f1e24e028, altered_table=0x7f5f1e0ba020, ha_alter_info=0x7f5f7746c7d0, old_table_def=0x7f5f1e07c8d0, new_table_def=0x7f5f1e07b0d0) at /home/hrvoje/sdc/release-8.0.20-11_dbg/storage/innobase/handler/handler0alter.cc:10405
      #10 0x000000000342cad2 in handler::ha_inplace_alter_table (this=0x7f5f1e24e028, altered_table=0x7f5f1e0ba020, ha_alter_info=0x7f5f7746c7d0, old_table_def=0x7f5f1e07c8d0, new_table_def=0x7f5f1e07b0d0) at /home/hrvoje/sdc/release-8.0.20-11_dbg/sql/handler.h:5906
      #11 0x0000000003937173 in mysql_inplace_alter_table (thd=0x7f5f1e020000, schema=..., new_schema=..., table_def=0x7f5f1e07c8d0, altered_table_def=0x7f5f1e07b0d0, table_list=0x7f5f1e227340, table=0x7f5f1e22a220, altered_table=0x7f5f1e0ba020, ha_alter_info=0x7f5f7746c7d0, inplace_supported=HA_ALTER_INPLACE_NO_LOCK_AFTER_PREPARE, alter_ctx=0x7f5f7746d720, columns=std::set with 0 elements, fk_key_info=0x7f5f1e0d4328, fk_key_count=0, fk_invalidator=0x7f5f7746d650) at /home/hrvoje/sdc/release-8.0.20-11_dbg/sql/sql_table.cc:12857
      #12 0x00000000039438c4 in mysql_alter_table (thd=0x7f5f1e020000, new_db=0x7f5f1e2278f8 "test", new_name=0x0, create_info=0x7f5f7746f210, table_list=0x7f5f1e227340, alter_info=0x7f5f7746f090) at /home/hrvoje/sdc/release-8.0.20-11_dbg/sql/sql_table.cc:16967
      #13 0x000000000376c6ae in Sql_cmd_alter_table::execute (this=0x7f5f1e227900, thd=0x7f5f1e020000) at /home/hrvoje/sdc/release-8.0.20-11_dbg/sql/sql_alter.cc:371
      #14 0x000000000386e17a in mysql_execute_command (thd=0x7f5f1e020000, first_level=true) at /home/hrvoje/sdc/release-8.0.20-11_dbg/sql/sql_parse.cc:4706
      #15 0x0000000003870bf8 in mysql_parse (thd=0x7f5f1e020000, parser_state=0x7f5f774709f0, update_userstat=false) at /home/hrvoje/sdc/release-8.0.20-11_dbg/sql/sql_parse.cc:5530
      #16 0x0000000003865539 in dispatch_command (thd=0x7f5f1e020000, com_data=0x7f5f77471b80, command=COM_QUERY) at /home/hrvoje/sdc/release-8.0.20-11_dbg/sql/sql_parse.cc:1826
      #17 0x000000000386395d in do_command (thd=0x7f5f1e020000) at /home/hrvoje/sdc/release-8.0.20-11_dbg/sql/sql_parse.cc:1303
      #18 0x0000000003a41269 in handle_connection (arg=0x7f5f693fedc0) at /home/hrvoje/sdc/release-8.0.20-11_dbg/sql/conn_handler/connection_handler_per_thread.cc:308
      #19 0x00000000052ff504 in pfs_spawn_thread (arg=0x7f5f76c6ba60) at /home/hrvoje/sdc/release-8.0.20-11_dbg/storage/perfschema/pfs.cc:2855
      #20 0x00007f5f7acccea5 in start_thread (arg=0x7f5f77472700) at pthread_create.c:307
      #21 0x00007f5f78bdf8dd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
      (gdb)
      

      sql:

      CREATE DATABASE test;
      USE test;
      set global innodb_file_per_table=off;
      CREATE TABLE t1(ol_o_id int,ol_d_id int,ol_w_id int,ol_number int,ol_tmp int,KEY (ol_w_id,ol_d_id,ol_o_id,ol_number)) PARTITION BY HASH (ol_w_id);
      ALTER TABLE t1 ADD COLUMN v2 CHAR(1),ALGORITHM=INSTANT;
      alter table t1 encryption='n';
      

      I'm able to reproduce this on both debug and release builds for 8.0.20-11. I'm able to reproduce it on 8.0.19-10, but not on 8.0.18-9.

      Upstream isn't affected:

      root@stretch:~# mysql
      Welcome to the MySQL monitor.  Commands end with ; or \g.
      Your MySQL connection id is 13
      Server version: 8.0.20 MySQL Community Server - GPL
      
      Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
      
      Oracle is a registered trademark of Oracle Corporation and/or its
      affiliates. Other names may be trademarks of their respective
      owners.
      
      Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
      
      mysql> CREATE DATABASE test;
      Query OK, 1 row affected (0.03 sec)
      
      mysql> USE test;
      Database changed
      mysql> set global innodb_file_per_table=off;
      Query OK, 0 rows affected (0.01 sec)
      
      mysql> CREATE TABLE t1(ol_o_id int,ol_d_id int,ol_w_id int,ol_number int,ol_tmp int,KEY (ol_w_id,ol_d_id,ol_o_id,ol_number)) PARTITION BY HASH (ol_w_id);
      Query OK, 0 rows affected (0.04 sec)
      
      mysql> ALTER TABLE t1 ADD COLUMN v2 CHAR(1),ALGORITHM=INSTANT;
      Query OK, 0 rows affected (0.03 sec)
      Records: 0  Duplicates: 0  Warnings: 0
      
      mysql> alter table t1 encryption='n';
      Query OK, 0 rows affected (0.03 sec)
      Records: 0  Duplicates: 0  Warnings: 0
      

        Attachments

          Activity

            People

            Assignee:
            robert.golebiowski Robert Golebiowski (Inactive)
            Reporter:
            hrvoje.matijakovic Hrvoje Matijakovic
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - Not Specified
                Not Specified
                Logged:
                Time Spent - 3 days, 35 minutes
                3d 35m

                  Smart Checklist