[MDEV-10777] Server crashed due to query_cache_info plugin Created: 2016-09-09  Updated: 2016-09-27  Resolved: 2016-09-27

Status: Closed
Project: MariaDB Server
Component/s: Plugins, Query Cache
Affects Version/s: 10.1.16
Fix Version/s: 10.1.18

Type: Bug Priority: Major
Reporter: Valerii Kravchuk Assignee: Oleksandr Byelkin
Resolution: Fixed Votes: 0
Labels: plugins

Sprint: 10.2.2-4, 10.1.18

 Description   

MariaDB 10.1.16 server crashed after running for 1 hour with the query_cache_info plugin enabled:

INSTALL PLUGIN query_cache_info SONAME 'query_cache_info';

with the following related settings:

mysql ((none))> show global variables like 'query%';
+------------------------------+----------+
| Variable_name | Value |
+------------------------------+----------+
| query_alloc_block_size | 16384 |
| query_cache_limit | 8388608 |
| query_cache_min_res_unit | 1024 |
| query_cache_size | 67108864 |
| query_cache_strip_comments | OFF |
| query_cache_type | ON |
| query_cache_wlock_invalidate | OFF |
| query_prealloc_size | 24576 |
+------------------------------+----------+

and query cache related status typically looking like this:

| Qcache_free_blocks                                           | 432                                              |
| Qcache_free_memory                                           | 14381680                                         |
| Qcache_hits                                                  | 1320200                                          |
| Qcache_inserts                                               | 1980307                                          |
| Qcache_lowmem_prunes                                         | 252808                                           |
| Qcache_not_cached                                            | 1089705                                          |
| Qcache_queries_in_cache                                      | 17940                                            |
| Qcache_total_blocks                                          | 37205                                            |

Stack trace is the following:

160909 10:36:35 [ERROR] mysqld got signal 11 ;
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.1.16-MariaDB
key_buffer_size=67108864
read_buffer_size=1048576
max_used_connections=61
max_threads=1002
thread_count=60
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 3164184 K bytes of memory
Hope that's ok; if not, decrease some variables in the equation.
 
Thread pointer: 0x0x7f5ec28ba008
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 = 0x7f6bd4dad288 thread_stack 0x48400
/opt/mysql/bin/mysqld(my_print_stacktrace+0x2e)[0xc099ee]
/opt/mysql/bin/mysqld(handle_fatal_signal+0x4ba)[0x7664da]
/lib64/libpthread.so.0(+0xf100)[0x7f6be9f89100]
/opt/mysql/lib/plugin/query_cache_info.so(+0xf35)[0x7f6bde5fef35]
/opt/mysql/bin/mysqld(_Z24get_schema_tables_resultP4JOIN23enum_schema_table_state+0x2ee)[0x612dfe]
/opt/mysql/bin/mysqld(_ZN4JOIN10exec_innerEv+0x907)[0x609927]
/opt/mysql/bin/mysqld(_Z12mysql_selectP3THDPPP4ItemP10TABLE_LISTjR4ListIS1_ES2_jP8st_orderSB_S2_SB_yP13select_resultP18st_select_lex_unitP13st_select_lex+0x28f)[0x60855f]
/opt/mysql/bin/mysqld(_Z13handle_selectP3THDP3LEXP13select_resultm+0x250)[0x60c130]
/opt/mysql/bin/mysqld[0x5ac8e8]
/opt/mysql/bin/mysqld(_Z21mysql_execute_commandP3THD+0x14f7)[0x5b2a97]
/opt/mysql/bin/mysqld(_Z11mysql_parseP3THDPcjP12Parser_state+0x2b4)[0x5baeb4]
/opt/mysql/bin/mysqld(_Z16dispatch_command19enum_server_commandP3THDPcj+0x23a7)[0x5bdee7]
/opt/mysql/bin/mysqld(_Z10do_commandP3THD+0x2a7)[0x5be2f7]
/opt/mysql/bin/mysqld(_Z24do_handle_one_connectionP3THD+0x183)[0x68d423]
/opt/mysql/bin/mysqld(handle_one_connection+0x42)[0x68d642]
/lib64/libpthread.so.0(+0x7dc5)[0x7f6be9f81dc5]
/lib64/libc.so.6(clone+0x6d)[0x7f6be8e5fced]

and crashing query was:

select statement_schema, statement_text, result_blocks_count, result_blocks_size from information_schema.query_cache_info



 Comments   
Comment by Oleksandr Byelkin [ 2016-09-14 ]

revision-id: 325a9c760c9b13a9748a0cee27a98455b558df30 (mariadb-10.1.17-11-g325a9c7)
parent(s): bb2c1a52c61706dde8c525a8887f2d364c0db1eb
committer: Oleksandr Byelkin
timestamp: 2016-09-14 18:15:03 +0200
message:

MDEV-10777: Server crashed due to query_cache_info plugin

Possible fix. Make the pluging more safe.

Comment by Oleksandr Byelkin [ 2016-09-16 ]

revision-id: 1665680172edf8799ac5668487e09f1f4a1144c7 (mariadb-10.1.17-11-g1665680)
parent(s): bb2c1a52c61706dde8c525a8887f2d364c0db1eb
committer: Oleksandr Byelkin
timestamp: 2016-09-16 21:30:03 +0200
message:

MDEV-10777: Server crashed due to query_cache_info plugin

Possible fix. Make the pluging more safe.

Comment by Vladislav Vaintroub [ 2016-09-23 ]

sanja: I looked at the patch, I understand the logic, and the patch could work, if the issue on hand is related to underlocking in the plugin.
I recommend to remove checking for NULLs where it is not necessary.

Yet, I'm still left to guess why it is necessary to have a new "ready" flag instead of using an already existing and extensively used rw lock when looking at query result chain.

Generated at Thu Feb 08 07:44:50 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.