Partitioning + load data local infile = deadlocks or crash
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
Percona XtraDB Cluster moved to https://jira.percona.com/projects/PXC | Status tracked in 5.6 | |||||
5.5 |
Won't Fix
|
Undecided
|
Unassigned | |||
5.6 |
Fix Released
|
Critical
|
Krunal Bauskar |
Bug Description
Hello.
I found the problem that occurs while trying to use partitioning and "load data local infile".
Test configuration (2 virtual machines):
OS: CentOS Linux release 7.1.1503 (Core)
PXC Version:
mysql> show variables like 'version%';
+------
| Variable_name | Value |
+------
| version | 5.6.22-72.0-56-log |
| version_comment | Percona XtraDB Cluster (GPL), Release rel72.0, Revision 978, WSREP version 25.8, wsrep_25.8.r4150 |
| version_
| version_compile_os | Linux |
+------
4 rows in set (0,00 sec)
Installed packets (from percona yum repo):
[root@vm-
Percona-
Percona-
Percona-
Percona-
percona-
Percona-
Percona-
percona-
Percona-
Percona-
Percona-
Wsrep status after first launch:
mysql> show status like 'wsrep%';
+------
| Variable_name | Value |
+------
.......
| wsrep_local_
.......
| wsrep_incoming_
.......
| wsrep_cluster_size | 2 |
.......
Test 1 (without partitioning):
mysql> create database `testdb`;
Query OK, 1 row affected (0,00 sec)
mysql> use testdb;
Database changed
mysql> CREATE TABLE `ip_test_table` (
-> `ip_use` int(10) unsigned NOT NULL,
-> `from_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
-> `to_time` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
-> `bytes` bigint(20) unsigned NOT NULL,
-> `dayofweek` tinyint(3) unsigned NOT NULL,
-> PRIMARY KEY (`from_
-> KEY `ip_use` (`ip_use`),
-> KEY `from_time` (`from_time`)
-> ) ENGINE=InnoDB DEFAULT CHARSET=cp1251;
Query OK, 0 rows affected (0,01 sec)
mysql> select count(*) from ip_test_table;
+----------+
| count(*) |
+----------+
| 0 |
+----------+
1 row in set (0,00 sec)
mysql> show create table ip_test_table\G
*******
Table: ip_test_table
Create Table: CREATE TABLE `ip_test_table` (
`ip_use` int(10) unsigned NOT NULL,
`from_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`to_time` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`bytes` bigint(20) unsigned NOT NULL,
`dayofweek` tinyint(3) unsigned NOT NULL,
PRIMARY KEY (`from_
KEY `ip_use` (`ip_use`),
KEY `from_time` (`from_time`)
) ENGINE=InnoDB DEFAULT CHARSET=cp1251
1 row in set (0,00 sec)
Trying to load data:
[root@vm-
[root@vm-
.......
mysql> select count(*) from ip_test_table;
+----------+
| count(*) |
+----------+
| 225245 |
+----------+
1 row in set (0,06 sec)
All is ok, the data is loaded into the table.
Test 2 (with partitioning):
mysql> drop table ip_test_table;
Query OK, 0 rows affected (0,02 sec)
mysql> CREATE TABLE `ip_test_table` (
-> `ip_use` int(10) unsigned NOT NULL,
-> `from_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
-> `to_time` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
-> `bytes` bigint(20) unsigned NOT NULL,
-> `dayofweek` tinyint(3) unsigned NOT NULL,
-> PRIMARY KEY (`from_
-> KEY `ip_use` (`ip_use`),
-> KEY `from_time` (`from_time`)
-> ) ENGINE=InnoDB DEFAULT CHARSET=cp1251
-> /*!50100 PARTITION BY LIST (dayofweek)
-> (PARTITION p_dayofweek_1 VALUES IN (1) ENGINE = InnoDB,
-> PARTITION p_dayofweek_2 VALUES IN (2) ENGINE = InnoDB,
-> PARTITION p_dayofweek_3 VALUES IN (3) ENGINE = InnoDB,
-> PARTITION p_dayofweek_4 VALUES IN (4) ENGINE = InnoDB,
-> PARTITION p_dayofweek_5 VALUES IN (5) ENGINE = InnoDB,
-> PARTITION p_dayofweek_6 VALUES IN (6) ENGINE = InnoDB,
-> PARTITION p_dayofweek_7 VALUES IN (7) ENGINE = InnoDB) */;
Query OK, 0 rows affected (0,06 sec)
mysql> show create table ip_test_table\G
*******
Table: ip_test_table
Create Table: CREATE TABLE `ip_test_table` (
`ip_use` int(10) unsigned NOT NULL,
`from_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`to_time` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`bytes` bigint(20) unsigned NOT NULL,
`dayofweek` tinyint(3) unsigned NOT NULL,
PRIMARY KEY (`from_
KEY `ip_use` (`ip_use`),
KEY `from_time` (`from_time`)
) ENGINE=InnoDB DEFAULT CHARSET=cp1251
/*!50100 PARTITION BY LIST (dayofweek)
(PARTITION p_dayofweek_1 VALUES IN (1) ENGINE = InnoDB,
PARTITION p_dayofweek_2 VALUES IN (2) ENGINE = InnoDB,
PARTITION p_dayofweek_3 VALUES IN (3) ENGINE = InnoDB,
PARTITION p_dayofweek_4 VALUES IN (4) ENGINE = InnoDB,
PARTITION p_dayofweek_5 VALUES IN (5) ENGINE = InnoDB,
PARTITION p_dayofweek_6 VALUES IN (6) ENGINE = InnoDB,
PARTITION p_dayofweek_7 VALUES IN (7) ENGINE = InnoDB) */
1 row in set (0,00 sec)
mysql> select count(*) from ip_test_table;
+----------+
| count(*) |
+----------+
| 0 |
+----------+
1 row in set (0,00 sec)
Trying to load data:
[root@vm-
ERROR 1213 (40001) at line 1: Deadlock found when trying to get lock; try restarting transaction
[root@vm-
ERROR 1213 (40001) at line 1: Deadlock found when trying to get lock; try restarting transaction
[root@vm-
ERROR 1213 (40001) at line 1: Deadlock found when trying to get lock; try restarting transaction
Oops! Deadlock found.
mysql> select count(*) from ip_test_table;
+----------+
| count(*) |
+----------+
| 0 |
+----------+
1 row in set (0,00 sec)
Error log:
2015-05-14 14:13:31 20180 [Warning] WSREP: SQL statement was ineffective, THD: 8, buf: 220980
QUERY: LOAD DATA LOCAL INFILE '/tmp/dumps/
=> Skipping replication
2015-05-14 14:13:31 20180 [Warning] WSREP: SQL statement was ineffective, THD: 8, buf: 220980
QUERY: LOAD DATA LOCAL INFILE '/tmp/dumps/
=> Skipping replication
2015-05-14 14:13:32 20180 [Warning] WSREP: SQL statement was ineffective, THD: 8, buf: 220980
QUERY: LOAD DATA LOCAL INFILE '/tmp/dumps/
=> Skipping replication
2015-05-14 14:13:40 20180 [Warning] WSREP: SQL statement was ineffective, THD: 9, buf: 220980
QUERY: LOAD DATA LOCAL INFILE '/tmp/dumps/
=> Skipping replication
2015-05-14 14:13:40 20180 [Warning] WSREP: SQL statement was ineffective, THD: 9, buf: 220980
QUERY: LOAD DATA LOCAL INFILE '/tmp/dumps/
=> Skipping replication
2015-05-14 14:13:41 20180 [Warning] WSREP: SQL statement was ineffective, THD: 9, buf: 220980
QUERY: LOAD DATA LOCAL INFILE '/tmp/dumps/
=> Skipping replication
2015-05-14 14:13:40 20180 [Warning] WSREP: SQL statement was ineffective, THD: 10, buf: 220980
QUERY: LOAD DATA LOCAL INFILE '/tmp/dumps/
=> Skipping replication
2015-05-14 14:13:40 20180 [Warning] WSREP: SQL statement was ineffective, THD: 10, buf: 220980
QUERY: LOAD DATA LOCAL INFILE '/tmp/dumps/
=> Skipping replication
2015-05-14 14:13:41 20180 [Warning] WSREP: SQL statement was ineffective, THD: 10, buf: 220980
QUERY: LOAD DATA LOCAL INFILE '/tmp/dumps/
=> Skipping replication
During the test of our mysql cluster, we got an error - "deadlock", but mysqld process did not crash.
We observed that problem in production for the first time (it works with large databases such as zabbix, cacti, websites, etc.).
When we tried to perform a "load data local infile" in production cluster, MySQL process crashed.
After that we got the following errors:
2015-05-13 15:02:34 24942 [Warning] WSREP: SQL statement was ineffective, THD: 7278815, buf: 220980
QUERY: LOAD DATA LOCAL INFILE '/tmp/caban/
=> Skipping replication
2015-05-13 15:02:34 24942 [ERROR] WSREP: FSM: no such a transition COMMITTED -> ROLLED_BACK
12:02:34 UTC - 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.
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.
Please help us make Percona XtraDB Cluster better by reporting any
bugs at https:/
key_buffer_
read_buffer_
max_used_
max_threads=2050
thread_count=151
connection_count=83
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_
Hope that's ok; if not, decrease some variables in the equation.
Thread pointer: 0x7fcbe9a1c000
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 = 7fcbcdeb9cf8 thread_stack 0x40000
/usr/sbin/
/usr/sbin/
/lib64/
/lib64/
/lib64/
/usr/lib64/
/usr/lib64/
/usr/lib64/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/lib64/
/lib64/
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (7fcc28289010): is an invalid pointer
Connection ID (thread ID): 7278815
Status: NOT_KILLED
You may download the Percona XtraDB Cluster operations manual by visiting
http://
in the manual which will help you identify the cause of the crash.
150513 15:02:35 mysqld_safe Number of processes running now: 0
150513 15:02:35 mysqld_safe WSREP: not restarting wsrep node automatically
150513 15:02:35 mysqld_safe mysqld from pid file /var/lib/
mysql> show variables like 'wsrep%splitting';
+------
| Variable_name | Value |
+------
| wsrep_load_
+------
1 row in set (0,00 sec)
mysql> show variables like 'wsrep%ws%';
+------
| Variable_name | Value |
+------
| wsrep_max_ws_rows | 1048576 |
| wsrep_max_ws_size | 2147483648 |
+------
2 rows in set (0,00 sec)
tags: | added: load-data |
tags: | added: crash pxc |
tags: | added: i61579 |
tags: | added: i64275 |
what is binlog_format setting for the session that does LOAD DATA?