Update of federated table and MyISAM table with one row crashes server
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
| MySQL Server |
Unknown
|
Unknown
|
||
| Percona Server moved to https://jira.percona.com/projects/PS |
Fix Released
|
Medium
|
George Ormond Lorch III | |
| 5.1 |
Fix Released
|
Medium
|
George Ormond Lorch III | |
| 5.5 |
Fix Released
|
Medium
|
George Ormond Lorch III | |
| 5.6 |
Fix Released
|
Medium
|
George Ormond Lorch III |
Bug Description
See testcase.sql attached. Multiple tables UPDATE involving federated table with one row crashes Percona server 5.1.x (5.1.59 and 5.1.68 at least):
[openxs@centos Percona-
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 7
Server version: 5.1.68rel14.5 Percona Server with XtraDB (GPL), Release rel14.5, Revision 513
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> use testcase
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> UPDATE user_dimension_f ud
-> INNER JOIN first_traded_data ftd
-> ON ftd.account_id = ud.account_id
-> SET ud.first_traded = ftd.first_traded
-> WHERE ud.first_traded IS NULL;
ERROR 2013 (HY000): Lost connection to MySQL server during query
mysql> 130521 19:56:32 mysqld_safe Number of processes running now: 0
130521 19:56:32 mysqld_safe mysqld restarted
mysql> exit
Bye
[openxs@centos Percona-
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 Server better by reporting any
bugs at http://
key_buffer_
read_buffer_
max_used_
max_threads=151
thread_count=2
connection_count=2
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: 0x1a99a20
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 = 7f6fb4562e68 thread_stack 0x40000
/home/openxs/
/home/openxs/
/lib64/
/home/openxs/
/home/openxs/
/home/openxs/
/home/openxs/
/home/openxs/
/home/openxs/
/home/openxs/
/home/openxs/
/home/openxs/
/home/openxs/
/home/openxs/
/home/openxs/
/lib64/
/lib64/
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (7f6f94004a00): UPDATE user_dimension_f ud INNER JOIN first_traded_data ftd ON ftd.account_id = ud.account_id SET ud.first_traded = ftd.first_traded WHERE ud.first_traded IS NULL
Connection ID (thread ID): 7
Status: NOT_KILLED
Related branches
- Alexey Kopytov (community): Approve on 2013-06-26
-
Diff: 228 lines (+180/-0) (has conflicts)3 files modifiedPercona-Server/mysql-test/suite/federated/federated_bug_68354.result (+80/-0)
Percona-Server/mysql-test/suite/federated/federated_bug_68354.test (+79/-0)
Percona-Server/storage/federated/ha_federated.cc (+21/-0)
- Alexey Kopytov (community): Approve on 2013-06-26
-
Diff: 186 lines (+163/-0) (has conflicts)3 files modifiedPercona-Server/mysql-test/suite/federated/federated_bug_68354.result (+80/-0)
Percona-Server/mysql-test/suite/federated/federated_bug_68354.test (+79/-0)
Percona-Server/storage/federated/ha_federated.cc (+4/-0)
- Alexey Kopytov (community): Approve on 2013-06-26
-
Diff: 349 lines (+0/-160)3 files modifiedPercona-Server/mysql-test/suite/federated/federated_bug_68354.result (+0/-80)
Percona-Server/mysql-test/suite/federated/federated_bug_68354.test (+0/-79)
Percona-Server/storage/federated/ha_federated.cc (+0/-1)
Valerii -
Are 5.5 and 5.6 affected? Do you have a GDB-resolved crash stacktrace?
The upstream crash stacktrace looks identical in function names, thus marking that bug as duplicate for now.
summary: |
- Upgrade of federated table crashes PS 5.1.x + Update of federated table crashes PS 5.1.x |
Test case from upstream http://
stack_bottom = 7fd02c065da8 thread_stack 0x40000
/tmp/Percona-
/tmp/Percona-
/lib64/
/tmp/Percona-
/tmp/Percona-
/tmp/Percona-
/tmp/Percona-
/tmp/Percona-
/tmp/Percona-
/tmp/Percona-
/tmp/Percona-
/tmp/Percona-
/tmp/Percona-
/tmp/Percona-
/tmp/Percona-
/lib64/
/lib64/
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (7fd014004ba0): UPDATE t1 JOIN t1fed ON t1.id = t1fed.id SET t1fed.message = t1.message
summary: |
- Update of federated table crashes PS 5.1.x + Update of federated table and MyISAM table with one row crashes server |
If local table with one row is InnoDB one I see no crash.
PS 5.6.10 is also affected:
stack_bottom = 7f689e040e28 thread_stack 0x40000
/tmp/Percona-
/tmp/Percona-
/lib64/
/tmp/Percona-
/tmp/Percona-
/tmp/Percona-
/tmp/Percona-
/tmp/Percona-
/tmp/Percona-
/tmp/Percona-
/tmp/Percona-
/tmp/Percona-
/tmp/Percona-
/tmp/Percona-
/tmp/Percona-
/tmp/Percona-
/tmp/Percona-
/tmp/Percona-
/lib64/
/lib64/
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (7f6884004f00): UPDATE user_dimension_f ud INNER JOIN first_traded_data ftd ON ftd.account_id = ud.account_id SET ud.first_traded = ftd.first_traded WHERE ud.first_traded IS NULL
Connection ID (thread ID): 1
Status: NOT_KILLED
tags: | added: upstream |
Upstream claims to have fixed this in 5.5.36 and 5.6.16:
5.5$ bzr log -r 4569
-------
revno: 4569
committer: Arun Kuruvila <email address hidden>
branch nick: mysql-5.5
timestamp: Mon 2013-12-30 11:39:55 +0530
message:
Bug #16324629 : SERVER CRASHES ON UPDATE/JOIN FEDERATED +
Description: When updating a federated table with UPDATE...
JOIN, the server consistently crashes with Signal 11 when
only 1 row exists in the local table involved in the join
and that 1 row can be joined with a row in the federated
table.
Analysis: Interaction between the federated engine and the
optimizer results in the crash. In our scenario, ie, local
table having only one row, the program is following a
different path because the table is treated as a constant
table by the join optimizer. So in this scenario
"index_read()" is happening in the prepare phase,
since optimizer plan is different for constant table joins.
In this case, "index_
calling "index_read()" and inside "index_read()", matching
rows are fetched and "stored_result" gets populated by
calling "store_result()". And just after "index_read()",
"index_end()" function is called. And in the "index_end()",
its freeing the "stored_result" by calling "free_result()".
So when it reaches the execution phase, in "position()"
function, we are getting assertion at
"DBUG_
table with more than 1 row), optimizer plan is different
and "index_read()" is happening in the execution phase.
Fix: So my fix is to have a separate ha_federated member
function for "index_
federated engine separately. So that position() will be
called before index_end() call in constant table scenario.
Shahriyar Rzayev (rzayev-sehriyar) wrote : | #8 |
Percona now uses JIRA for bug reports so this bug report is migrated to: https:/
This upstream bug can be related: http:// bugs.mysql. com/bug. php?id= 68354