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

Running ALTER TABLE ... AUTO_INCREMENT could lead to a server crash [ZN7myrocks10ha_rocksdb31load_auto_incr_value_from_indexEv+0x11c]

    XMLWordPrintable

    Details

      Description

      Testcase:

      # mysqld options required for replay:  --plugin-load-add=RocksDB=ha_rocksdb.so
      CREATE DATABASE test;
      USE test;
      set default_storage_engine=RocksDB;
      CREATE TABLE t0(c0 BLOB);
      INSERT INTO t0 VALUES(0);
      ALTER TABLE t0 AUTO_INCREMENT=0;
      

      gdb info:

      +bt
      #0  0x00007f9d4ebd99b1 in __pthread_kill (threadid=<optimized out>, signo=11) at ../nptl/sysdeps/unix/sysv/linux/pthread_kill.c:61
      #1  0x0000000001871633 in my_write_core (sig=11) at /home/hrvoje/worktable/PS-5.7.21_dbg/mysys/stacktrace.c:249
      #2  0x0000000000e9018f in handle_fatal_signal (sig=11) at /home/hrvoje/worktable/PS-5.7.21_dbg/sql/signal_handler.cc:223
      #3  <signal handler called>
      #4  0x00007f9d0ef8ee5a in myrocks::ha_rocksdb::load_auto_incr_value_from_index (this=0x7f9d05054030) at /home/hrvoje/worktable/PS-5.7.21_dbg/storage/rocksdb/ha_rocksdb.cc:4449
      #5  0x00007f9d0efa2ee5 in myrocks::ha_rocksdb::prepare_inplace_alter_table (this=0x7f9d05054030, altered_table=0x7f9d050cae20, ha_alter_info=0x7f9d4f1c7890) at /home/hrvoje/worktable/PS-5.7.21_dbg/storage/rocksdb/ha_rocksdb.cc:10794      #6  0x0000000000f27719 in handler::ha_prepare_inplace_alter_table (this=0x7f9d05054030, altered_table=0x7f9d050cae20, ha_alter_info=0x7f9d4f1c7890) at /home/hrvoje/worktable/PS-5.7.21_dbg/sql/handler.cc:5101
      #7  0x00000000015cc3fb in mysql_inplace_alter_table (thd=0x7f9d05019000, table_list=0x7f9d0502c9d0, table=0x7f9d0507b220, altered_table=0x7f9d050cae20, ha_alter_info=0x7f9d4f1c7890, inplace_supported=HA_ALTER_INPLACE_SHARED_LOCK_AFTER_PREPARE, target_mdl_request=0x7f9d4f1c72d0, alter_ctx=0x7f9d4f1c7e20) at /home/hrvoje/worktable/PS-5.7.21_dbg/sql/sql_table.cc:7753
      #8  0x00000000015d2200 in mysql_alter_table (thd=0x7f9d05019000, new_db=0x7f9d0502cf58 "test", new_name=0x0, create_info=0x7f9d4f1c8ae0, table_list=0x7f9d0502c9d0, alter_info=0x7f9d4f1c8a10) at /home/hrvoje/worktable/PS-5.7.21_dbg/sql/sql_table.cc:10198
      #9  0x0000000001741dcc in Sql_cmd_alter_table::execute (this=0x7f9d0502cf68, thd=0x7f9d05019000) at /home/hrvoje/worktable/PS-5.7.21_dbg/sql/sql_alter.cc:338
      #10 0x0000000001539327 in mysql_execute_command (thd=0x7f9d05019000, first_level=true) at /home/hrvoje/worktable/PS-5.7.21_dbg/sql/sql_parse.cc:5117
      #11 0x000000000153b3c3 in mysql_parse (thd=0x7f9d05019000, parser_state=0x7f9d4f1ca470) at /home/hrvoje/worktable/PS-5.7.21_dbg/sql/sql_parse.cc:5901
      #12 0x000000000152ff13 in dispatch_command (thd=0x7f9d05019000, com_data=0x7f9d4f1cac50, command=COM_QUERY) at /home/hrvoje/worktable/PS-5.7.21_dbg/sql/sql_parse.cc:1490
      #13 0x000000000152ed9b in do_command (thd=0x7f9d05019000) at /home/hrvoje/worktable/PS-5.7.21_dbg/sql/sql_parse.cc:1021
      #14 0x000000000166f4c8 in handle_connection (arg=0x7f9d34e46850) at /home/hrvoje/worktable/PS-5.7.21_dbg/sql/conn_handler/connection_handler_per_thread.cc:312
      #15 0x000000000191b351 in pfs_spawn_thread (arg=0x7f9d4ac18d20) at /home/hrvoje/worktable/PS-5.7.21_dbg/storage/perfschema/pfs.cc:2190
      #16 0x00007f9d4ebd4e25 in start_thread (arg=0x7f9d4f1cb700) at pthread_create.c:308
      #17 0x00007f9d4cda834d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113
      

      error_log:

      Thread pointer: 0x7f9d05019000
      Attempting backtrace. You can use the following information to find out
      where mysqld died. If you see no messages after this, something went
      terribly wrong...
      stack_bottom = 7f9d4f1caca0 thread_stack 0x40000
      /sda/PS090218-percona-server-5.7.21-20-linux-x86_64-debug/bin/mysqld(my_print_stacktrace+0x35)[0x18715ac]
      /sda/PS090218-percona-server-5.7.21-20-linux-x86_64-debug/bin/mysqld(handle_fatal_signal+0x411)[0xe8ff98]
      /lib64/libpthread.so.0(+0xf5e0)[0x7f9d4ebdc5e0]
      /sda/PS090218-percona-server-5.7.21-20-linux-x86_64-debug/lib/mysql/plugin/ha_rocksdb.so(_ZN7myrocks10ha_rocksdb31load_auto_incr_value_from_indexEv+0x11c)[0x7f9d0ef8ee5a]
      /sda/PS090218-percona-server-5.7.21-20-linux-x86_64-debug/lib/mysql/plugin/ha_rocksdb.so(_ZN7myrocks10ha_rocksdb27prepare_inplace_alter_tableEP5TABLEP18Alter_inplace_info+0x763)[0x7f9d0efa2ee5]
      /sda/PS090218-percona-server-5.7.21-20-linux-x86_64-debug/bin/mysqld(_ZN7handler30ha_prepare_inplace_alter_tableEP5TABLEP18Alter_inplace_info+0x81)[0xf27719]                                                                                 /sda/PS090218-percona-server-5.7.21-20-linux-x86_64-debug/bin/mysqld[0x15cc3fb]
      /sda/PS090218-percona-server-5.7.21-20-linux-x86_64-debug/bin/mysqld(_Z17mysql_alter_tableP3THDPKcS2_P24st_ha_create_informationP10TABLE_LISTP10Alter_info+0x1d3c)[0x15d2200]
      /sda/PS090218-percona-server-5.7.21-20-linux-x86_64-debug/bin/mysqld(_ZN19Sql_cmd_alter_table7executeEP3THD+0x52a)[0x1741dcc]
      /sda/PS090218-percona-server-5.7.21-20-linux-x86_64-debug/bin/mysqld(_Z21mysql_execute_commandP3THDb+0x6cde)[0x1539327]
      /sda/PS090218-percona-server-5.7.21-20-linux-x86_64-debug/bin/mysqld(_Z11mysql_parseP3THDP12Parser_state+0x705)[0x153b3c3]
      /sda/PS090218-percona-server-5.7.21-20-linux-x86_64-debug/bin/mysqld(_Z16dispatch_commandP3THDPK8COM_DATA19enum_server_command+0xc59)[0x152ff13]
      /sda/PS090218-percona-server-5.7.21-20-linux-x86_64-debug/bin/mysqld(_Z10do_commandP3THD+0x521)[0x152ed9b]
      /sda/PS090218-percona-server-5.7.21-20-linux-x86_64-debug/bin/mysqld(handle_connection+0x294)[0x166f4c8]
      /sda/PS090218-percona-server-5.7.21-20-linux-x86_64-debug/bin/mysqld(pfs_spawn_thread+0x170)[0x191b351]
      /lib64/libpthread.so.0(+0x7e25)[0x7f9d4ebd4e25]
      /lib64/libc.so.6(clone+0x6d)[0x7f9d4cda834d]
      

      Version info (release branch for RM-321):

      Server version: 5.7.21-20-debug MySQL Community Server (GPL)
      

        Smart Checklist

          Attachments

            Activity

              People

              Assignee:
              george.lorch George Lorch
              Reporter:
              hrvoje.matijakovic Hrvoje Matijakovic
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 2 hours, 2 minutes
                  2h 2m