[PS8QA] Assertion `!part_share' failed in bool native_part::Partition_base::in it_part_share()
General
Escalation
General
Escalation
Description
Environment
None
duplicates
Smart Checklist
Activity
Show:
Ramesh Sivaraman December 21, 2018 at 6:40 AM
Confirmed this issue is causing with index_merge_union access algorithm.
mysql> explain DELETE FROM t1 WHERE a<0 OR b='';
+----+-------------+-------+------------+-------------+---------------+-----------+---------+------+------+----------+-------------------------------------+
| id | select_type | table | partitions | type | possible_keys | key | key_len | ref | rows | filtered | Extra |
+----+-------------+-------+------------+-------------+---------------+-----------+---------+------+------+----------+-------------------------------------+
| 1 | DELETE | t1 | p0,p1,p2 | index_merge | PRIMARY,b | PRIMARY,b | 4,5 | NULL | 2 | 100.00 | Using union(PRIMARY,b); Using where |
+----+-------------+-------+------------+-------------+---------------+-----------+---------+------+------+----------+-------------------------------------+
1 row in set, 1 warning (0.00 sec)
mysql>
PS will not crash if we turn off index_merge_union
mysql> insert into t1 values(768,0);
Query OK, 1 row affected (0.00 sec)
mysql> SET SESSION optimizer_switch="index_merge_union=off";
Query OK, 0 rows affected (0.00 sec)
mysql> DELETE FROM t1 WHERE a<0 OR b='';
Query OK, 1 row affected (0.00 sec)
PS will crash if index_merge_union is turned on
mysql> insert into t1 values(768,0);
Query OK, 1 row affected (0.00 sec)
mysql> DELETE FROM t1 WHERE a<0 OR b='';
ERROR 2013 (HY000): Lost connection to MySQL server during query
mysql>
Ramesh Sivaraman December 20, 2018 at 9:29 AM
@Laurynas Biveinis Reproduced with release build. Could not reproduce with RocksDB.
GDB trace from release build
#0 __pthread_kill (threadid=<optimized out>, signo=signo@entry=11) at ../sysdeps/unix/sysv/linux/pthread_kill.c:62
62 ../sysdeps/unix/sysv/linux/pthread_kill.c: No such file or directory.
[Current thread is 1 (Thread 0x7f4e442b3700 (LWP 8365))]
(gdb) bt
+bt
#0 __pthread_kill (threadid=<optimized out>, signo=signo@entry=11) at ../sysdeps/unix/sysv/linux/pthread_kill.c:62
#1 0x0000000001caee07 in my_write_core (sig=sig@entry=11) at stacktrace.cc:278
#2 0x0000000000fc9ced in handle_fatal_signal (sig=11) at signal_handler.cc:254
#3 <signal handler called>
#4 handler::get_ha_share_ptr (this=this@entry=0x7f4df81b4760) at handler.cc:8155
#5 0x0000000000c279bd in native_part::Partition_base::get_share (this=this@entry=0x7f4df81b4760) at partitioning/partition_base.cc:1463
#6 0x0000000000c27a85 in native_part::Partition_base::init_part_share (this=this@entry=0x7f4df81b4760) at partitioning/partition_base.cc:1435
#7 0x0000000000c27d78 in native_part::Partition_base::open (this=0x7f4df81b4760, name=0x7f4df81cc088 "./test/t1", mode=39, test_if_locked=2, table_def=0x0) at partitioning/partition_base.cc:1571
#8 0x0000000000c33183 in handler::ha_open (this=this@entry=0x7f4df81b4760, table_arg=<optimized out>, name=name@entry=0x7f4df81cc088 "./test/t1", mode=39, test_if_locked=test_if_locked@entry=2, table_def=table_def@entry=0x0) at handler.cc:2838
#9 0x00007f4e63c728a2 in ha_tokupart::clone (this=0x7f4df81aa118, name=0x7f4df81cc088 "./test/t1", mem_root=0x7f4df8003068) at ha_tokupart.cc:70
#10 0x0000000000d8253c in QUICK_RANGE_SELECT::init_ror_merged_scan (this=0x7f4df81a80f0, reuse_handler=<optimized out>) at opt_range.cc:1995
#11 0x0000000000d82928 in QUICK_ROR_UNION_SELECT::reset (this=0x7f4df81e3100) at opt_range.cc:2204
#12 0x0000000000dce2dc in IndexRangeScanIterator::Init (this=0x7f4e442b0738) at records.cc:337
#13 0x0000000000e4b8e5 in Sql_cmd_delete::delete_from_single_table (this=0x7f4df81b4270, thd=0x7f4df8000b50) at sql_delete.cc:446
#14 0x0000000000ee97df in Sql_cmd_dml::execute (this=0x7f4df81b4270, thd=0x7f4df8000b50) at sql_select.cc:596
#15 0x0000000000e93a7c in mysql_execute_command (thd=thd@entry=0x7f4df8000b50, first_level=first_level@entry=true) at sql_parse.cc:4528
#16 0x0000000000e9922c in mysql_parse (thd=thd@entry=0x7f4df8000b50, parser_state=parser_state@entry=0x7f4e442b1dd0, update_userstat=update_userstat@entry=false, force_primary_storage_engine=force_primary_storage_engine@entry=false) at sql_parse.cc:5269
#17 0x0000000000e9c7cf in dispatch_command (thd=thd@entry=0x7f4df8000b50, com_data=com_data@entry=0x7f4e442b2d00, command=COM_QUERY) at sql_parse.cc:1734
#18 0x0000000000e9d440 in do_command (thd=thd@entry=0x7f4df8000b50) at sql_parse.cc:1290
#19 0x0000000000fb8950 in handle_connection (arg=arg@entry=0x431bbb0) at conn_handler/connection_handler_per_thread.cc:317
#20 0x0000000001d5a8af in pfs_spawn_thread (arg=0x43bf690) at pfs.cc:2836
#21 0x00007f4eae89b6ba in start_thread (arg=0x7f4e442b3700) at pthread_create.c:333
#22 0x00007f4eacc4f41d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109
Laurynas Biveinis December 20, 2018 at 9:08 AMEdited
Please check release build, and try with RocksDB too
Duplicate
Details
Assignee
UnassignedUnassignedReporter
Ramesh SivaramanRamesh Sivaraman(Deactivated)Time tracking
5m loggedComponents
Priority
High
Details
Details
Assignee
Unassigned
UnassignedReporter
Ramesh Sivaraman
Ramesh Sivaraman(Deactivated)Time tracking
5m logged
Components
Priority
Smart Checklist
Open Smart Checklist
Smart Checklist
Open Smart Checklist
Smart Checklist

Open Smart Checklist
Created December 20, 2018 at 8:32 AM
Updated March 6, 2024 at 12:31 PM
Resolved December 20, 2018 at 1:17 PM
Testcase
rm -Rf /dev/shm/1545282369 mkdir -p /dev/shm/1545282369/tmp /home/ramesh/pquery/PS181218-percona-server-8.0.13-2-linux-x86_64-debug/bin/mysqld --no-defaults --initialize-insecure --basedir=/home/ramesh/pquery/PS181218-percona-server-8.0.13-2-linux-x86_64-debug --datadir=/dev/shm/1545282369/data /home/ramesh/pquery/PS181218-percona-server-8.0.13-2-linux-x86_64-debug/bin/mysqld --no-defaults --basedir=/home/ramesh/pquery/PS181218-percona-server-8.0.13-2-linux-x86_64-debug --datadir=/dev/shm/1545282369/data --tmpdir=/dev/shm/1545282369/tmp --port=34281 --pid-file=/dev/shm/1545282369/pid.pid --core-file --socket=/dev/shm/1545282369/socket.sock --plugin-load=TokuDB=ha_tokudb.so --sql_mode= --log-error=/dev/shm/1545282369/error.log.out & CREATE DATABASE test; USE test; CREATE TABLE t1(a int,b CHAR (1),PRIMARY KEY (a),KEY (b)) ENGINE=TokuDB PARTITION BY HASH (a) PARTITIONS 3; insert into t1 values(3,''); INSERT INTO t1 VALUES(0,"aaaaa"); insert into t1 values(768,0); DELETE FROM t1 WHERE a<0 OR b='';
GDB Info
#0 __pthread_kill (threadid=<optimized out>, signo=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:62 #1 0x00000000045b0bb2 in my_write_core (sig=6) at /home/ramesh/pquery/PS-8.0-release_dbg/mysys/stacktrace.cc:278 #2 0x000000000344525f in handle_fatal_signal (sig=6) at /home/ramesh/pquery/PS-8.0-release_dbg/sql/signal_handler.cc:254 #3 <signal handler called> #4 0x00007f5bdde85428 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54 #5 0x00007f5bdde8702a in __GI_abort () at abort.c:89 #6 0x00007f5bdde7dbd7 in __assert_fail_base (fmt=<optimized out>, assertion=assertion@entry=0x4f76af1 "!part_share", file=file@entry=0x4f764a8 "/home/ramesh/pquery/PS-8.0-release_dbg/sql/partitioning/partition_base.cc", line=line@entry=1430, function=function@entry=0x4f77f60 <native_part::Partition_base::init_part_share()::__PRETTY_FUNCTION__> "bool native_part::Partition_base::init_part_share()") at assert.c:92 #7 0x00007f5bdde7dc82 in __GI___assert_fail (assertion=0x4f76af1 "!part_share", file=0x4f764a8 "/home/ramesh/pquery/PS-8.0-release_dbg/sql/partitioning/partition_base.cc", line=1430, function=0x4f77f60 <native_part::Partition_base::init_part_share()::__PRETTY_FUNCTION__> "bool native_part::Partition_base::init_part_share()") at assert.c:101 #8 0x0000000002ea6f67 in native_part::Partition_base::init_part_share (this=0x7f5ad0144a40) at /home/ramesh/pquery/PS-8.0-release_dbg/sql/partitioning/partition_base.cc:1430 #9 0x0000000002ea797e in native_part::Partition_base::open (this=0x7f5ad0144a40, name=0x7f5ad0162e28 "./test/t1", mode=39, test_if_locked=2, table_def=0x0) at /home/ramesh/pquery/PS-8.0-release_dbg/sql/partitioning/partition_base.cc:1571 #10 0x0000000002ecb60d in handler::ha_open (this=0x7f5ad0144a40, table_arg=0x7f5ad0165370, name=0x7f5ad0162e28 "./test/t1", mode=39, test_if_locked=2, table_def=0x0) at /home/ramesh/pquery/PS-8.0-release_dbg/sql/handler.cc:2838 #11 0x00007f5b784255e9 in ha_tokupart::clone (this=0x7f5ad0147218, name=0x7f5ad0162e28 "./test/t1", mem_root=0x7f5ad0003130) at /home/ramesh/pquery/PS-8.0-release_dbg/storage/tokudb/ha_tokupart.cc:70 #12 0x00000000030ad387 in QUICK_RANGE_SELECT::init_ror_merged_scan (this=0x7f5ad01320b0, reuse_handler=false) at /home/ramesh/pquery/PS-8.0-release_dbg/sql/opt_range.cc:1995 #13 0x00000000030adf6d in QUICK_ROR_UNION_SELECT::reset (this=0x7f5ad0171cd0) at /home/ramesh/pquery/PS-8.0-release_dbg/sql/opt_range.cc:2204 #14 0x00000000031264bc in IndexRangeScanIterator::Init (this=0x7f5bb01338d8) at /home/ramesh/pquery/PS-8.0-release_dbg/sql/records.cc:337 #15 0x00000000031ea10a in Sql_cmd_delete::delete_from_single_table (this=0x7f5ad01445e8, thd=0x7f5ad0000be0) at /home/ramesh/pquery/PS-8.0-release_dbg/sql/sql_delete.cc:446 #16 0x00000000031eb9e2 in Sql_cmd_delete::execute_inner (this=0x7f5ad01445e8, thd=0x7f5ad0000be0) at /home/ramesh/pquery/PS-8.0-release_dbg/sql/sql_delete.cc:790 #17 0x00000000032d9275 in Sql_cmd_dml::execute (this=0x7f5ad01445e8, thd=0x7f5ad0000be0) at /home/ramesh/pquery/PS-8.0-release_dbg/sql/sql_select.cc:596 #18 0x000000000327050b in mysql_execute_command (thd=0x7f5ad0000be0, first_level=true) at /home/ramesh/pquery/PS-8.0-release_dbg/sql/sql_parse.cc:3482 #19 0x0000000003276559 in mysql_parse (thd=0x7f5ad0000be0, parser_state=0x7f5bb0135300, update_userstat=false, force_primary_storage_engine=false) at /home/ramesh/pquery/PS-8.0-release_dbg/sql/sql_parse.cc:5269 #20 0x000000000326b45f in dispatch_command (thd=0x7f5ad0000be0, com_data=0x7f5bb0135cd0, command=COM_QUERY) at /home/ramesh/pquery/PS-8.0-release_dbg/sql/sql_parse.cc:1734 #21 0x00000000032699d6 in do_command (thd=0x7f5ad0000be0) at /home/ramesh/pquery/PS-8.0-release_dbg/sql/sql_parse.cc:1290 #22 0x000000000342eb10 in handle_connection (arg=0x89c01f0) at /home/ramesh/pquery/PS-8.0-release_dbg/sql/conn_handler/connection_handler_per_thread.cc:317 #23 0x00000000046a7ac2 in pfs_spawn_thread (arg=0x897b270) at /home/ramesh/pquery/PS-8.0-release_dbg/storage/perfschema/pfs.cc:2836 #24 0x00007f5bdfbaf6ba in start_thread (arg=0x7f5bb0136700) at pthread_create.c:333 #25 0x00007f5bddf5741d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109