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

MariaDB server crasesh when OPTIMIZING several tables (mysql_alter_table)

    XMLWordPrintable

Details

    Description

      Hi,

      When I run mysqloptimize -A, MariaDB crashes. If I try to optimize the tables manually, one by one, it works fine. Only happens when I try to optimize several tables at the same time. I also tried with OPTIMIZE table1, table2, ... and it crashes.
      The tables can be empty (without data, only structure) and crashes.

      {{0x7fade406d700 InnoDB: Assertion failure in file /home/buildbot/buildbot/build/mariadb-10.9.3/storage/innobase/page/page0zip.cc line 760
      InnoDB: Failing assertion: i + PAGE_HEAP_NO_USER_LOW == n_heap
      InnoDB: We intentionally generate a memory trap.
      InnoDB: Submit a detailed bug report to https://jira.mariadb.org/
      InnoDB: If you get repeated assertion failures or crashes, even
      InnoDB: immediately after the mariadbd startup, there may be
      InnoDB: corruption in the InnoDB tablespace. Please refer to
      InnoDB: https://mariadb.com/kb/en/library/innodb-recovery-modes/
      InnoDB: about forcing recovery.
      220921 9:41:59 [ERROR] mysqld got signal 6 ;
      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.

      To report this bug, see https://mariadb.com/kb/en/reporting-bugs

      We will try our best to scrape up some info that will hopefully help
      diagnose the problem, but since we have already crashed,
      something is definitely wrong and this may fail.

      Server version: 10.9.3-MariaDB-1:10.9.3+maria~ubu2004-log
      key_buffer_size=268435456
      read_buffer_size=131072
      max_used_connections=2
      max_threads=502
      thread_count=2
      It is possible that mysqld could use up to
      key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 8564374 K bytes of memory
      Hope that's ok; if not, decrease some variables in the equation.

      Thread pointer: 0x7fac80000c58
      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 = 0x7fade406cd98 thread_stack 0x30000
      ??:0(my_print_stacktrace)[0x556e4767eb52]
      ??:0(handle_fatal_signal)[0x556e471522b5]
      ??:0(__restore_rt)[0x7fae2d865420]
      ??:0(gsignal)[0x7fae2d06f00b]
      ??:0(abort)[0x7fae2d04e859]
      ??:0(Wsrep_server_service::log_dummy_write_set(wsrep::client_state&, wsrep::ws_meta const&))[0x556e46d890f9]
      ??:0(Wsrep_server_service::log_dummy_write_set(wsrep::client_state&, wsrep::ws_meta const&))[0x556e46d74fa4]
      ??:0(std::pair<std::_Rb_tree_iterator<std::pair<unsigned long const, bool> >, bool> std::_Rb_tree<unsigned long, std::pair<unsigned long const, bool>, std::_Select1st<std::pair<unsigned long const, bool> >, std::less<unsigned long>, std::allocator<std::pair<unsigned long const, bool> > >::_M_emplace_unique<unsigned long&, bool>(unsigned long&, bool&&))[0x556e47555fe6]
      ??:0(std::pair<std::_Rb_tree_iterator<std::pair<unsigned long const, bool> >, bool> std::_Rb_tree<unsigned long, std::pair<unsigned long const, bool>, std::_Select1st<std::pair<unsigned long const, bool> >, std::less<unsigned long>, std::allocator<std::pair<unsigned long const, bool> > >::_M_emplace_unique<unsigned long&, bool>(unsigned long&, bool&&))[0x556e475563f4]
      ??:0(std::pair<std::_Rb_tree_iterator<std::pair<unsigned long const, bool> >, bool> std::_Rb_tree<unsigned long, std::pair<unsigned long const, bool>, std::_Select1st<std::pair<unsigned long const, bool> >, std::less<unsigned long>, std::allocator<std::pair<unsigned long const, bool> > >::_M_emplace_unique<unsigned long&, bool>(unsigned long&, bool&&))[0x556e47555923]
      ??:0(void std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_construct<char*>(char*, char*, std::forward_iterator_tag))[0x556e474d682d]
      ??:0(void std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_construct<char*>(char*, char*, std::forward_iterator_tag))[0x556e474df9ed]
      ??:0(void std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_construct<char*>(char*, char*, std::forward_iterator_tag))[0x556e474e06d4]
      ??:0(void std::this_thread::sleep_for<long, std::ratio<1l, 1l> >(std::chrono::duration<long, std::ratio<1l, 1l> > const&))[0x556e4744cdff]
      ??:0(mysql_alter_table(THD*, st_mysql_const_lex_string const*, st_mysql_const_lex_string const*, Table_specification_st*, TABLE_LIST*, Alter_info*, unsigned int, st_order*, bool, bool))[0x556e46fbf3f6]
      ??:0(mysql_recreate_table(THD*, TABLE_LIST*, bool))[0x556e46fc019f]
      ??:0(MDL_ticket::~MDL_ticket())[0x556e47031fcd]
      ??:0(fill_check_table_metadata_fields(THD*, List<Item>*))[0x556e47034844]
      ??:0(Sql_cmd_optimize_table::execute(THD*))[0x556e470361b5]
      ??:0(mysql_execute_command(THD*, bool))[0x556e46f059be]
      ??:0(mysql_parse(THD*, char*, unsigned int, Parser_state*))[0x556e46ef55d7]
      ??:0(dispatch_command(enum_server_command, THD*, char*, unsigned int, bool))[0x556e46f01825]
      ??:0(do_command(THD*, bool))[0x556e46f03a7e]
      ??:0(do_handle_one_connection(CONNECT*, bool))[0x556e47026917]
      ??:0(handle_one_connection)[0x556e47026c6d]
      ??:0(MyCTX_nopad::finish(unsigned char*, unsigned int*))[0x556e4737ac96]
      ??:0(start_thread)[0x7fae2d859609]
      ??:0(clone)[0x7fae2d14b133]

      Trying to get some variables.
      Some pointers may be invalid and cause the dump to abort.
      Query (0x7fac80058a90): OPTIMIZE TABLE `oc_cards`

      Connection ID (thread ID): 94
      Status: NOT_KILLED

      Optimizer switch: index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on,not_null_range_scan=off

      The manual page at https://mariadb.com/kb/en/how-to-produce-a-full-stack-trace-for-mysqld/ contains
      information that should help you find out what is causing the crash.
      Writing a core file...
      Working directory at /var/lib/mysql
      Resource Limits:
      Limit Soft Limit Hard Limit Units
      Max cpu time unlimited unlimited seconds
      Max file size unlimited unlimited bytes
      Max data size unlimited unlimited bytes
      Max stack size 8388608 unlimited bytes
      Max core file size 0 unlimited bytes
      Max resident set unlimited unlimited bytes
      Max processes 127942 127942 processes
      Max open files 32768 32768 files
      Max locked memory 8388608 8388608 bytes
      Max address space unlimited unlimited bytes
      Max file locks unlimited unlimited locks
      Max pending signals 127942 127942 signals
      Max msgqueue size 819200 819200 bytes
      Max nice priority 0 0
      Max realtime priority 0 0
      Max realtime timeout unlimited unlimited us
      Core pattern: core

      Kernel version: Linux version 5.19.4-edge (github@pve-bullseye) (gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2) #1 SMP PREEMPT_DYNAMIC PVE Edge 5.19.4-1 (2022-08-25)}}

      Attachments

        Issue Links

          Activity

            People

              thiru Thirunarayanan Balathandayuthapani
              xkill Pablo Catalina
              Votes:
              0 Vote for this issue
              Watchers:
              4 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.