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

INSERTs into specific partitions crashing server

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Critical
    • Resolution: Incomplete
    • Affects Version/s: 10.3.18, 10.4.8
    • Fix Version/s: N/A
    • Component/s: Partitioning
    • Labels:
    • Environment:
      Affects Linux and Windows. Affects Community and Enterprise.

      Description

      The following insert into a specific partition leads to a crash in 10.3 and 10.4. This works in 10.2 and prior.

      CREATE TABLE `t` (
      `id` INT(5) NOT NULL AUTO_INCREMENT,
      PRIMARY KEY (`id`)
      ) ENGINE=INNODB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
      PARTITION BY HASH (`id`)
      (PARTITION `p1`, 
      PARTITION `p2`);
       
      INSERT INTO t PARTITION (p1) VALUES (1);
      

      Command line output:

      mysql> select version();
      +--------------------+
      | version()          |
      +--------------------+
      | 10.4.8-MariaDB-log |
      +--------------------+
      1 row in set (0.00 sec)
       
      mysql> CREATE TABLE `t` (
          -> `id` INT(5) NOT NULL AUTO_INCREMENT,
          -> PRIMARY KEY (`id`)
          -> ) ENGINE=INNODB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
          -> PARTITION BY HASH (`id`)
          -> (PARTITION `p1`,
          -> PARTITION `p2`);
      Query OK, 0 rows affected (1.58 sec)
       
      mysql> INSERT INTO t PARTITION (p1) VALUES (1);
      ERROR 2013 (HY000): Lost connection to MySQL server during query
      

      Note the above would generate an error in 10.1 and 10.2:

      ERROR 1748 (HY000): Found a row not matching the given partition set
      

      However, if you change the partition to p2 (i.e., the "correct" partition), it still crashes in 10.3 and 10.4!

      mysql> INSERT INTO t6 PARTITION (p2) VALUES (1);
      ERROR 2013 (HY000): Lost connection to MySQL server during query
      

      Whereas it inserts normally in 10.1 and 10.2:

      mysql> INSERT INTO t6 PARTITION (p2) VALUES (1);
      Query OK, 1 row affected (0.06 sec)
      

      Error log stack trace from 10.4.8:

      2019-10-28 17:50:38 0 [Note] C:\Program Files\MariaDB 10.4\bin\mysqld.exe: ready for connections.
      Version: '10.4.8-MariaDB-log'  socket: ''  port: 3319  mariadb.org binary distribution
      191028 17:52:58 [ERROR] mysqld got exception 0xc0000005 ;
      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.4.8-MariaDB-log
      key_buffer_size=8388608
      read_buffer_size=131072
      max_used_connections=1
      max_threads=65537
      thread_count=28
      It is possible that mysqld could use up to 
      key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 13503 K  bytes of memory
      Hope that's ok; if not, decrease some variables in the equation.
       
      Thread pointer: 0x9ea7558
      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...
      mysqld.exe!parse_user()
      mysqld.exe!strmov()
      mysqld.exe!strmov()
      mysqld.exe!?ha_write_row@handler@@QEAAHPEBE@Z()
      mysqld.exe!?write_record@@YAHPEAVTHD@@PEAUTABLE@@PEAUst_copy_info@@@Z()
      mysqld.exe!?mysql_insert@@YA_NPEAVTHD@@PEAUTABLE_LIST@@AEAV?$List@VItem@@@@AEAV?$List@V?$List@VItem@@@@@@22W4enum_duplicates@@_N@Z()
      mysqld.exe!?mysql_execute_command@@YAHPEAVTHD@@@Z()
      mysqld.exe!?mysql_parse@@YAXPEAVTHD@@PEADIPEAVParser_state@@_N3@Z()
      mysqld.exe!?dispatch_command@@YA_NW4enum_server_command@@PEAVTHD@@PEADI_N3@Z()
      mysqld.exe!?do_command@@YA_NPEAVTHD@@@Z()
      mysqld.exe!?pool_of_threads_scheduler@@YAXPEAUscheduler_functions@@PEAKPEAI@Z()
      mysqld.exe!?tp_callback@@YAXPEAUTP_connection@@@Z()
      ntdll.dll!TpPostWork()
      ntdll.dll!TpDisassociateCallback()
      kernel32.dll!BaseThreadInitThunk()
      ntdll.dll!RtlUserThreadStart()
       
      Trying to get some variables.
      Some pointers may be invalid and cause the dump to abort.
      Query (0x9d6ca20): INSERT INTO t PARTITION (p1) VALUES (1)
      Connection ID (thread ID): 30
      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
       
      The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
      information that should help you find out what is causing the crash.
      Writing a core file at C:\Program Files\MariaDB 10.4\data\
      

      This also occurs with RANGE partitioning too.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              ccalender Chris Calender
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: