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

ALTERing TokuDB table with clustering key can lead to a server crash

    Details

    • Type: Bug
    • Status: On Hold
    • Priority: High
    • Resolution: Unresolved
    • Affects Version/s: 8.0.12-2rc1, 5.7.23-25, 5.6.42-84.2
    • Fix Version/s: None
    • Component/s: TokuDB
    • Labels:
      None

      Description

      sql:

      # mysqld options required for replay: --plugin-load=tokudb=ha_tokudb.so
      USE test;
      create table foo(a int,b int,c int,d int,primary key (a),key (b),clustering key (c))engine=TokuDB;
      alter table foo add column aaa int,drop index b,add index b(b);
      

      gdb:

      (gdb) bt
      +bt
      #0  0x00007fab630c6a01 in __pthread_kill (threadid=<optimized out>, signo=11) at ../nptl/sysdeps/unix/sysv/linux/pthread_kill.c:61
      #1  0x0000000000ad1d4e in my_write_core (sig=11) at /home/hrvoje/worktable/PS-5.6.42-84.2_dbg/mysys/stacktrace.c:424
      #2  0x000000000073f59d in handle_fatal_signal (sig=11) at /home/hrvoje/worktable/PS-5.6.42-84.2_dbg/sql/signal_handler.cc:236
      #3  <signal handler called>
      #4  0x00007fab41837798 in fill_dynamic_row_mutator (buf=0x7faaca812763 "\001", columns=0x7fab636b3ee0, num_columns=1, src_table=0x7faacaa0fe00, src_kc_info=0x7faaca9ea070, keynr=2, is_add=true, out_has_blobs=0x7fab636b3e97) at /home/hrvoje/worktable/PS-5.6.42-84.2_dbg/storage/tokudb/ha_tokudb_alter_common.cc:383
      #5  0x00007fab41837ec6 in ha_tokudb::fill_row_mutator (this=0x7faaca824010, buf=0x7faaca812740 "", columns=0x7fab636b3ee0, num_columns=1, altered_table=0x7faacaa0fe00, altered_kc_info=0x7faaca9ea070, keynr=2, is_add=true) at /home/hrvoje/worktable/PS-5.6.42-84.2_dbg/storage/tokudb/ha_tokudb_alter_common.cc:548
      #6  0x00007fab4183a991 in ha_tokudb::alter_table_add_or_drop_column (this=0x7faaca824010, altered_table=0x7faacaa0fe00, ha_alter_info=0x7fab636b4780) at /home/hrvoje/worktable/PS-5.6.42-84.2_dbg/storage/tokudb/ha_tokudb_alter_56.cc:886
      #7  0x00007fab41839e22 in ha_tokudb::inplace_alter_table (this=0x7faaca824010, altered_table=0x7faacaa0fe00, ha_alter_info=0x7fab636b4780) at /home/hrvoje/worktable/PS-5.6.42-84.2_dbg/storage/tokudb/ha_tokudb_alter_56.cc:612
      #8  0x00000000008718df in handler::ha_inplace_alter_table (this=0x7faaca824010, altered_table=0x7faacaa0fe00, ha_alter_info=0x7fab636b4780) at /home/hrvoje/worktable/PS-5.6.42-84.2_dbg/sql/handler.h:3030
      #9  0x0000000000869754 in mysql_inplace_alter_table (thd=0x7fab37fb5000, table_list=0x7faaca81f140, table=0x7faaca88b600, altered_table=0x7faacaa0fe00, ha_alter_info=0x7fab636b4780, inplace_supported=HA_ALTER_INPLACE_EXCLUSIVE_LOCK, target_mdl_request=0x7fab636b41d0, alter_ctx=0x7fab636b4ce0) at /home/hrvoje/worktable/PS-5.6.42-84.2_dbg/sql/sql_table.cc:6978
      #10 0x000000000086e691 in mysql_alter_table (thd=0x7fab37fb5000, new_db=0x7faaca81f6a0 "test", new_name=0x0, create_info=0x7fab636b5ba0, table_list=0x7faaca81f140, alter_info=0x7fab636b5ae0, order_num=0, order=0x0, ignore=false) at /home/hrvoje/worktable/PS-5.6.42-84.2_dbg/sql/sql_table.cc:9045
      #11 0x00000000009b8aff in Sql_cmd_alter_table::execute (this=0x7faaca81f860, thd=0x7fab37fb5000) at /home/hrvoje/worktable/PS-5.6.42-84.2_dbg/sql/sql_alter.cc:346
      #12 0x00000000007fbb4c in mysql_execute_command (thd=0x7fab37fb5000) at /home/hrvoje/worktable/PS-5.6.42-84.2_dbg/sql/sql_parse.cc:5586
      #13 0x00000000007ff1ec in mysql_parse (thd=0x7fab37fb5000, rawbuf=0x7faaca81f010 "alter table foo add column aaa int,drop index b,add index b(b)", length=62, parser_state=0x7fab636b7470, update_userstat=false) at /home/hrvoje/worktable/PS-5.6.42-84.2_dbg/sql/sql_parse.cc:7056
      #14 0x00000000007f0f04 in dispatch_command (command=COM_QUERY, thd=0x7fab37fb5000, packet=0x7fab2abe7001 "alter table foo add column aaa int,drop index b,add index b(b)", packet_length=62) at /home/hrvoje/worktable/PS-5.6.42-84.2_dbg/sql/sql_parse.cc:1524
      #15 0x00000000007efcd1 in do_command (thd=0x7fab37fb5000) at /home/hrvoje/worktable/PS-5.6.42-84.2_dbg/sql/sql_parse.cc:1093
      #16 0x00000000007b6ff0 in do_handle_one_connection (thd_arg=0x7fab37f52000) at /home/hrvoje/worktable/PS-5.6.42-84.2_dbg/sql/sql_connect.cc:1590
      #17 0x00000000007b6cf7 in handle_one_connection (arg=0x7fab37f52000) at /home/hrvoje/worktable/PS-5.6.42-84.2_dbg/sql/sql_connect.cc:1494
      #18 0x0000000000b15149 in pfs_spawn_thread (arg=0x7fab37f41de0) at /home/hrvoje/worktable/PS-5.6.42-84.2_dbg/storage/perfschema/pfs.cc:1861
      #19 0x00007fab630c1e25 in start_thread (arg=0x7fab636b8700) at pthread_create.c:308
      #20 0x00007fab61292bad in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113
      

      Reproduced on both release and debug builds for RM-383.
      I'm able to reproduce it on a release build for 5.6.41-84.1 as well.

        Smart Checklist

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  Unassigned
                  Reporter:
                  hrvoje.matijakovic Hrvoje Matijakovic
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  5 Start watching this issue

                  Dates

                  • Created:
                    Updated:

                    Time Tracking

                    Estimated:
                    Original Estimate - Not Specified
                    Not Specified
                    Remaining:
                    Remaining Estimate - Not Specified
                    Not Specified
                    Logged:
                    Time Spent - 1 hour, 25 minutes
                    1h 25m