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

Setting keep_files_on_create with TokuDB can lead to a crash

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: On Hold
    • Priority: Medium
    • Resolution: Unresolved
    • Affects Version/s: 5.7.x
    • Fix Version/s: None
    • Component/s: TokuDB
    • Labels:
      None

      Description

      Setting the keep_files_on_create can lead to a crash on the debug build when TokuDB is used.

      sql:

      # mysqld options required for replay: --plugin-load=TokuDB=ha_tokudb.so
      CREATE DATABASE test;
      USE test;
      CREATE TABLE t0(a INT)ENGINE=TokuDB;
      xa start 0x0,0x0,0xb;
      SET @@global.table_open_cache=TRUE;
      insert INTO t0 values(0);
      handler t0 open as a0;
      SET STATEMENT keep_files_on_create=OFF FOR SELECT * FROM t0;
      
      ./1573379246_run
      Executing testcase ./1573379246.sql against mysqld with socket /dev/shm/1573379246/socket.sock using the mysql CLI client...
      ERROR 1031 (HY000) at line 8: Table storage engine for 'a0' doesn't have this option
      ERROR 2013 (HY000) at line 9: Lost connection to MySQL server during query
      

      gdb from the debug build:

      Core was generated by `/sdc/PS071119-percona-server-5.7.28-31-linux-x86_64-debug/bin/mysqld --no-defau'.
      Program terminated with signal 6, Aborted.
      #0  0x00007fc443ecea61 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  0x00007fc443ecea61 in __pthread_kill (threadid=<optimized out>, signo=6) at ../nptl/sysdeps/unix/sysv/linux/pthread_kill.c:59
      #1  0x000000000191dbc2 in my_write_core (sig=6) at /sdc/release-5.7.28-31_dbg/mysys/stacktrace.c:261
      #2  0x000000000169474b in handle_fatal_signal (sig=6) at /sdc/release-5.7.28-31_dbg/sql/signal_handler.cc:230
      #3  <signal handler called>
      #4  0x00007fc441fd0337 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:55
      #5  0x00007fc441fd1a28 in __GI_abort () at abort.c:90
      #6  0x00007fc441fc9156 in __assert_fail_base (fmt=0x7fc442124be0 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x22c435e "mh->m_magic == 1234", file=file@entry=0x22c4288 "/sdc/release-5.7.28-31_dbg/mysys/my_malloc.c", line=line@entry=140, function=function@entry=0x22c4430 <__PRETTY_FUNCTION__.11050> "my_free") at assert.c:92
      #7  0x00007fc441fc9202 in __GI___assert_fail (assertion=0x22c435e "mh->m_magic == 1234", file=0x22c4288 "/sdc/release-5.7.28-31_dbg/mysys/my_malloc.c", line=140, function=0x22c4430 <__PRETTY_FUNCTION__.11050> "my_free") at assert.c:101
      #8  0x0000000001917fb2 in my_free (ptr=0x7fc3b24c9218) at /sdc/release-5.7.28-31_dbg/mysys/my_malloc.c:140
      #9  0x00007fc40443e80f in tokudb::memory::free (ptr=0x7fc3b24c9218) at /sdc/release-5.7.28-31_dbg/storage/tokudb/tokudb_memory.h:52
      #10 0x00007fc40443c143 in tokudb_lock_timeout_callback (db=0x7fc3b244f380, requesting_txnid=9, left_key=0x7fc4444bc648, right_key=0x7fc4047fce10 <toku_dbt_positive_infinity()::positive_infinity_dbt>, blocking_txnid=5) at /sdc/release-5.7.28-31_dbg/storage/tokudb/hatoku_hton.cc:1654
      #11 0x00007fc404465141 in toku_db_wait_range_lock (db=0x7fc3b244f380, txn=0x7fc3b248c200, request=0x7fc4444bc620) at /sdc/release-5.7.28-31_dbg/storage/tokudb/PerconaFT/src/ydb_row_lock.cc:244
      #12 0x00007fc40445d820 in c_getf_last (c=0x7fc3b2411580, flag=0, f=0x7fc404406299 <smart_dbt_do_nothing(DBT const*, DBT const*, void*)>, extra=0x0) at /sdc/release-5.7.28-31_dbg/storage/tokudb/PerconaFT/src/ydb_cursor.cc:283
      #13 0x00007fc40445de10 in c_getf_prev (c=0x7fc3b2411580, flag=0, f=0x7fc404406299 <smart_dbt_do_nothing(DBT const*, DBT const*, void*)>, extra=0x0) at /sdc/release-5.7.28-31_dbg/storage/tokudb/PerconaFT/src/ydb_cursor.cc:388
      #14 0x00007fc40440d1c8 in ha_tokudb::may_table_be_empty (this=0x7fc3b24ae030, txn=0x7fc3b248c200) at /sdc/release-5.7.28-31_dbg/storage/tokudb/ha_tokudb.cc:3218
      #15 0x00007fc404408ed1 in ha_tokudb::initialize_share (this=0x7fc3b24ae030, name=0x7fc3b2432a08 "./test/t0", mode=2) at /sdc/release-5.7.28-31_dbg/storage/tokudb/ha_tokudb.cc:1714
      #16 0x00007fc40440952f in ha_tokudb::open (this=0x7fc3b24ae030, name=0x7fc3b2432a08 "./test/t0", mode=2, test_if_locked=2) at /sdc/release-5.7.28-31_dbg/storage/tokudb/ha_tokudb.cc:1842
      #17 0x0000000000f2d0a4 in handler::ha_open (this=0x7fc3b24ae030, table_arg=0x7fc3b245c220, name=0x7fc3b2432a08 "./test/t0", mode=2, test_if_locked=2) at /sdc/release-5.7.28-31_dbg/sql/handler.cc:2959
      #18 0x00000000016379d5 in open_table_from_share (thd=0x7fc3b2419000, share=0x7fc3b2432630, alias=0x7fc3b2427e28 "t0", db_stat=39, prgflag=8, ha_open_flags=0, outparam=0x7fc3b245c220, is_create_table=false) at /sdc/release-5.7.28-31_dbg/sql/table.cc:3496
      #19 0x00000000014b99e0 in open_table (thd=0x7fc3b2419000, table_list=0x7fc3b2427e30, ot_ctx=0x7fc4444bd090) at /sdc/release-5.7.28-31_dbg/sql/sql_base.cc:3634
      #20 0x00000000014bc5ee in open_and_process_table (thd=0x7fc3b2419000, lex=0x7fc3b241b6b0, tables=0x7fc3b2427e30, counter=0x7fc3b241b770, flags=0, prelocking_strategy=0x7fc4444bd180, has_prelocking_list=false, ot_ctx=0x7fc4444bd090) at /sdc/release-5.7.28-31_dbg/sql/sql_base.cc:5275
      #21 0x00000000014bd753 in open_tables (thd=0x7fc3b2419000, start=0x7fc4444bd140, counter=0x7fc3b241b770, flags=0, prelocking_strategy=0x7fc4444bd180) at /sdc/release-5.7.28-31_dbg/sql/sql_base.cc:5893
      #22 0x00000000014bea63 in open_tables_for_query (thd=0x7fc3b2419000, tables=0x7fc3b2427e30, flags=0) at /sdc/release-5.7.28-31_dbg/sql/sql_base.cc:6668
      #23 0x0000000001549819 in execute_sqlcom_select (thd=0x7fc3b2419000, all_tables=0x7fc3b2427e30) at /sdc/release-5.7.28-31_dbg/sql/sql_parse.cc:5461
      #24 0x000000000154297d in mysql_execute_command (thd=0x7fc3b2419000, first_level=true) at /sdc/release-5.7.28-31_dbg/sql/sql_parse.cc:3016
      #25 0x000000000154a918 in mysql_parse (thd=0x7fc3b2419000, parser_state=0x7fc4444be440, update_userstat=false) at /sdc/release-5.7.28-31_dbg/sql/sql_parse.cc:5927
      #26 0x000000000153f2a2 in dispatch_command (thd=0x7fc3b2419000, com_data=0x7fc4444bec70, command=COM_QUERY) at /sdc/release-5.7.28-31_dbg/sql/sql_parse.cc:1539
      #27 0x000000000153e0c3 in do_command (thd=0x7fc3b2419000) at /sdc/release-5.7.28-31_dbg/sql/sql_parse.cc:1060
      #28 0x00000000016710f2 in handle_connection (arg=0x7fc427bfeac0) at /sdc/release-5.7.28-31_dbg/sql/conn_handler/connection_handler_per_thread.cc:325
      #29 0x00000000019418ae in pfs_spawn_thread (arg=0x7fc440018d20) at /sdc/release-5.7.28-31_dbg/storage/perfschema/pfs.cc:2198
      #30 0x00007fc443ec9e65 in start_thread (arg=0x7fc4444bf700) at pthread_create.c:307
      #31 0x00007fc44209888d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
      

      Release build results in a crash/hang onshutdown:

      2019-11-13T11:00:59.098104Z 0 [Note] /sdc/PS071119-percona-server-5.7.28-31-linux-x86_64-opt/bin/mysqld: ready for connections.
      Version: '5.7.28-31'  socket: '/dev/shm/1573379246/socket.sock'  port: 31628  MySQL Community Server (GPL)
      11:01:21 UTC - mysqld got signal 11 ;
      This could be because you hit a bug. It is also possible that this binary
      or one of the libraries it was linked against is corrupt, improperly built,
      or misconfigured. This error can also be caused by malfunctioning hardware.
      Attempting to collect some information that could help diagnose the problem.
      As this is a crash and something is definitely wrong, the information
      collection process might fail.
      Please help us make Percona Server better by reporting any
      bugs at https://bugs.percona.com/
      
      key_buffer_size=8388608
      read_buffer_size=131072
      max_used_connections=1
      max_threads=152
      thread_count=0
      connection_count=0
      It is possible that mysqld could use up to
      key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 68337 K  bytes of memory
      Hope that's ok; if not, decrease some variables in the equation.
      
      Thread pointer: 0x0
      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 = 0 thread_stack 0x40000
      2019-11-13T11:01:21.634364Z 0 [Note] Giving 0 client threads a chance to die gracefully
      2019-11-13T11:01:21.634388Z 0 [Note] Shutting down slave threads
      2019-11-13T11:01:21.634401Z 0 [Note] Forcefully disconnecting 0 remaining clients
      2019-11-13T11:01:21.634412Z 0 [Note] Event Scheduler: Purging the queue. 0 events
      /sdc/PS071119-percona-server-5.7.28-31-linux-x86_64-opt/bin/mysqld(my_print_stacktrace+0x2c)[0xe6b43c]
      /sdc/PS071119-percona-server-5.7.28-31-linux-x86_64-opt/bin/mysqld(handle_fatal_signal+0x479)[0xca30d9]
      /lib64/libpthread.so.0(+0xf5f0)[0x7fdbfae685f0]
      /usr/lib64/libjemalloc.so.1(+0x1056d)[0x7fdbfb08556d]
      /usr/lib64/libjemalloc.so.1(+0x2b6c1)[0x7fdbfb0a06c1]
      /usr/lib64/libjemalloc.so.1(+0x2bdee)[0x7fdbfb0a0dee]
      /usr/lib64/libjemalloc.so.1(+0x2bfc3)[0x7fdbfb0a0fc3]
      /lib64/libpthread.so.0(+0x7c62)[0x7fdbfae60c62]
      /lib64/libpthread.so.0(+0x7e73)[0x7fdbfae60e73]
      /lib64/libc.so.6(clone+0x6d)[0x7fdbf902f88d]
      You may download the Percona Server operations manual by visiting
      http://www.percona.com/software/percona-server/. You may find information
      in the manual which will help you identify the cause of the crash.
      

      Assertion string mh->m_magic == 1234 looks similar to PS-4943.

        Smart Checklist

          Attachments

            Activity

              People

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

                Dates

                Created:
                Updated: