[MDEV-19079] Server crash on read_statistics_for_tables_if_needed Created: 2019-03-29 Updated: 2019-05-31 Resolved: 2019-05-31 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Optimizer, Server |
| Affects Version/s: | 10.2.22, 10.2.23 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Alex Lee | Assignee: | Alice Sherepa |
| Resolution: | Incomplete | Votes: | 0 |
| Labels: | need_feedback | ||
| Environment: |
Happened on Windows, but it should happen both on Windows and Linux |
||
| Issue Links: |
|
||||||||
| Description |
|
Recently we got a crash on our MariaDB server, the call stack is
The main problem is that the it try to read histogram of a performance schema table. In my understand, only TABLE_CATEGORY_USER should be read statistics because on open_and_process_table it only init stats when table is TABLE_CATEGORY_USER.
to
which means only mysql stats table will be ignored. This code change may be not correct. |
| Comments |
| Comment by Varun Gupta (Inactive) [ 2019-04-11 ] | |||||||||||||
|
elemount can you share the query that you are running.
and it does not crash. Also we had https://jira.mariadb.org/browse/MDEV-16507 which made sure that we don't read statistics for table.
there is a condition that is !is_temporary_table(tl) | |||||||||||||
| Comment by Alex Lee [ 2019-04-11 ] | |||||||||||||
|
@Varun, it happened when the "optimizer_use_condition_selectivity=4". In this condition, it try to call read_histograms_for_table and thus crash. | |||||||||||||
| Comment by Varun Gupta (Inactive) [ 2019-04-11 ] | |||||||||||||
|
elemount the above observations were with optimizer_use_condition_selectivity=4, I even checked 10.4 where optimizer_use_condition is set to 4 by default | |||||||||||||
| Comment by Varun Gupta (Inactive) [ 2019-04-11 ] | |||||||||||||
|
This is what I get when i run on 10.2
Can you share the query and also the entire stack trace? | |||||||||||||
| Comment by Alex Lee [ 2019-04-11 ] | |||||||||||||
|
11 00000005`6096a800 00000005`01596baf mysqld!alloc_histograms_for_table_share+0x9c [d:\src\sql\sql_statistics.cc @ 2410] | |||||||||||||
| Comment by Alex Lee [ 2019-04-11 ] | |||||||||||||
|
Source code is based on 10.2.22 | |||||||||||||
| Comment by Alex Lee [ 2019-04-11 ] | |||||||||||||
|
And call on the table performance_schema.events_statements_summary_by_digest | |||||||||||||
| Comment by Alice Sherepa [ 2019-04-12 ] | |||||||||||||
|
Could you please provide the test case to demonstrate the problem and your configuration of the server. | |||||||||||||
| Comment by Varun Gupta (Inactive) [ 2019-05-03 ] | |||||||||||||
|
elemount for your information, |