[MDEV-2914] LP:957409 - Crash in create_internal_tmp_table or OOM or internal error: 'Using too big key for internal temp tables' with derived_with_keys=on, FROM subquery or view Created: 2012-03-16 Updated: 2015-02-02 Resolved: 2012-10-04 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | ||
| Reporter: | jocelyn fournier | Assignee: | Igor Babaev |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | Launchpad | ||
| Attachments: |
|
| Description |
|
Hi, I've just hit a bug with MariaDB 5.3.5-ga. The stack trace is the following : Mar 15 16:57:46 mysql mysqld: 2d2d2d d:2d:2d [ERROR] mysqld got signal 11 ; Mar 15 16:57:46 mysql mysqld: stack_bottom = 7fc0f7ccae98 thread_stack 0x3c000 The query : SELECT tmp.*, m.photo , m.login member_name, m.sexe, pv.name plateform_name FROM ((SELECT mp.product_id id, mp.date_review, mp.status, mp.plateform_id, mp.id review_id, mp.member_id, mp.note, mp.nb_comment, mp.review_all, mp.review_like, mp.selection, mp.conso_future, mpd.review, mpd.review_status, mpd.title_review from sc_member_product_light mp LEFT JOIN sc_member_product_detail mpd ON mpd.member_id = mp.member_id AND mpd.product_id = mp.product_id where mp.product_id = 366123681178224 AND is_review = 1 AND mp.status = 0 AND mp.note > 5 order by review_like DESC, review_all ASC, note DESC limit 1) UNION (SELECT mp.product_id id, mp.date_review, mp.status, mp.plateform_id, mp.id review_id, mp.member_id, mp.note, mp.nb_comment, mp.review_all, mp.review_like, mp.selection, mp.conso_future, mpd.review, mpd.review_status, mpd.title_review from sc_member_product_light mp LEFT JOIN sc_member_product_detail mpd ON mpd.member_id = mp.member_id AND mpd.product_id = mp.product_id where mp.product_id = 366123681178224 AND is_review = 1 AND mp.status = 0 AND mp.note <= 5 order by review_like DESC, review_all ASC, note ASC limit 1)) as tmp JOIN sc_member m ON m.id = tmp.member_id LEFT JOIN sc_param_values pv ON pv.id = tmp.plateform_id Optimizer switch: index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=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=off,table_elimination=on and execution plan ---
---
--- The crash is quite random. The query could finish successfully or just issue a Before trying to dig more and try to make a reproducable testcase, is there any specific parameters I could control which could explain the reported memory allocation ? Thanks and regards, |
| Comments |
| Comment by jocelyn fournier [ 2012-03-16 ] |
|
Re: Crash in create_internal_tmp_table Actually, I've been able to reproduce one time the crash with the following table and datas, with the same query as above : http://www.wiktik.com/error.tar.gz HTH, |
| Comment by Elena Stepanova [ 2012-03-16 ] |
|
Re: Crash in create_internal_tmp_table How much memory do you actually have? As indicated in the error log, key_buffer_size=1073741824 – That said, we had a very similar issue reported once (https://bugs.launchpad.net/maria/+bug/929603), for 5.3.3-rc, but it does not seem to be reproducible with the reporter's use case and data any longer, so we would greatly appreciate if you could provide more info about yours: DDL for tables used in the query, and, if possible, the data dump (it can be uploaded to ftp://ftp.askmonty.org. If you cannot provide the table contents, please at least give us the idea about the amount of data stored there. The DDLs (SHOW CREATE TABLE <table name> results) are still very important. Thank you. |
| Comment by Elena Stepanova [ 2012-03-16 ] |
|
Re: Crash in create_internal_tmp_table |
| Comment by Elena Stepanova [ 2012-03-16 ] |
|
Re: Crash in create_internal_tmp_table |
| Comment by jocelyn fournier [ 2012-03-16 ] |
|
Re: Crash in create_internal_tmp_table The right one : http://static1.wiktik.com/error.tar.gz Note that the latest query execution has produced the following error : ERROR 1928 (HY000): Internal error: 'Using too big key for internal temp tables' |
| Comment by jocelyn fournier [ 2012-03-16 ] |
|
Re: Crash in create_internal_tmp_table aria_pagecache_buffer_size = 1G |
| Comment by jocelyn fournier [ 2012-03-16 ] |
|
Re: Crash in create_internal_tmp_table |
| Comment by Elena Stepanova [ 2012-03-16 ] |
|
Re: Crash in create_internal_tmp_table thank you, I got both OOM and 'Using too big key for internal temp tables'. |
| Comment by Elena Stepanova [ 2012-03-17 ] |
|
Re: Crash in create_internal_tmp_table or OOM or internal error: 'Using too big key for internal temp tables' with derived_with_keys=on, FROM subquery or view It seems that the problem has been fixed in the current maria/5.3 tree in revision 3459, along with the bug https://bugs.launchpad.net/maria/+bug/953649. If you build binaries yourself, please pick up the latest code and try if it works for you. If you are using release builds, please try to switch off 'derived_with_keys' in optimizer switch, as a workaround till the next version is released: add optimizer_switch=derived_with_keys=off to your cnf file (and set it globally on the server, if you don't want to restart it at the moment). If you do either of that, please let us know whether it worked for you. Meanwhile, I will ask Igor who fixed the other bug whether it should have been expected to fix this one, too, or it just happened to mask it and we still need to do some work about it. Thank you. |
| Comment by Elena Stepanova [ 2012-03-17 ] |
|
Re: Crash in create_internal_tmp_table or OOM or internal error: 'Using too big key for internal temp tables' with derived_with_keys=on, FROM subquery or view As said above, the problem described in the bug is reproducible on maria-5.3 up to and including revno 3458, and but not on revno 3459 and further. Revision 3459 is your fix for https://bugs.launchpad.net/maria/+bug/953649. Could you please take a look and advise whether it is expected to fix the problem(s) described here, too, or it just changed something so that test cases provided here don't trigger the issue any longer, while it might still exist? I hope you will be able to say just looking at it, but I will also attach a test case which is not minimal, but is considerably smaller than the initial one. I run it as "perl ./mtr test_oom", without any custom parameters. The offending query in it is SELECT COUNT COUNT is not important, it is here just for convenience as sometimes the query returns thousands of rows instead of expected 1. The issue appears in different ways, with the same or similar data and query it can be a crash, or out of memory error, or 'Using too big key for internal temp tables', or even a ridiculous result. However, valgrind warnings are all similar if not identical: Conditional jump or move depends on uninitialised value(s) etc. EXPLAIN: id select_type table type possible_keys key key_len ref rows filtered Extra |
| Comment by Elena Stepanova [ 2012-03-17 ] |
|
Re: Crash in create_internal_tmp_table or OOM or internal error: 'Using too big key for internal temp tables' with derived_with_keys=on, FROM subquery or view |
| Comment by Elena Stepanova [ 2012-03-17 ] |
|
Test case mentioned in the comment #10 |
| Comment by Igor Babaev [ 2012-03-17 ] |
|
Re: Crash in create_internal_tmp_table or OOM or internal error: 'Using too big key for internal temp tables' with derived_with_keys=on, FROM subquery or view |
| Comment by Igor Babaev [ 2012-03-18 ] |
|
Re: Crash in create_internal_tmp_table or OOM or internal error: 'Using too big key for internal temp tables' with derived_with_keys=on, FROM subquery or view |
| Comment by Elena Stepanova [ 2012-04-27 ] |
|
Re: Crash in create_internal_tmp_table or OOM or internal error: 'Using too big key for internal temp tables' with derived_with_keys=on, FROM subquery or view |
| Comment by Rasmus Johansson (Inactive) [ 2012-04-27 ] |
|
Launchpad bug id: 957409 |