[MDEV-24152] mysqld segfault - signal 11 - optimizer get_best_combination Created: 2020-11-05 Updated: 2020-11-23 Resolved: 2020-11-23 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Server |
| Affects Version/s: | 10.4.8 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Martin Roman | Assignee: | Unassigned |
| Resolution: | Cannot Reproduce | Votes: | 0 |
| Labels: | crash, need_feedback | ||
| Environment: |
Debian GNU/Linux 10 (buster) |
||
| Attachments: |
|
| Description |
|
I'm getting MariaDB mysqld signal 11 error. It has appeared from one day to another and it looks to be caused by running the below query (a day before it worked fine) - no data is returned but the query generates relatively complex explain due to nested views. The error appears randomly. Could you please advice what to do with that? I'm enclosing the error log, the explain of the query, the query itself and source of the underlying view. Thank you. Martin
|
| Comments |
| Comment by Daniel Black [ 2020-11-06 ] |
|
can you include `show create table gisa_mpe_unis.x_bpej`? |
| Comment by Daniel Black [ 2020-11-06 ] |
|
Can you try a later 10.4 release? A new release will be out sometime next week because of a major regression in 10.4.16. |
| Comment by Martin Roman [ 2020-11-06 ] |
|
Attached x_bpej.sql |
| Comment by Martin Roman [ 2020-11-06 ] |
|
I'd forgot to include one information - the db server is virtual running on vmware. |
| Comment by Martin Roman [ 2020-11-06 ] |
|
MariaDB upgrade is not an option for the moment. |
| Comment by Daniel Black [ 2020-11-06 ] |
|
With x_bpej I was trying to get to a base table, however looking at the explain I can assume this is several layers deep. Generally a VM scenario isn't a major consideration. Is it possible to however clone the VM, upgrade the clone and verify its not fixed in the latest 10.4? If its not fixed it might be worth trying to come up with a simpler query with less layers of views. |
| Comment by Martin Roman [ 2020-11-06 ] |
|
Ok, understand. I'll verify the options with my colleagues and come back to you with the decision. With regard to queries with many layers of views. Is there any parameter / variable in MariaDB configuration that can control explain complexity and prevent the database server from crashing when such a kind of query is invoked by some user? |
| Comment by Daniel Black [ 2020-11-07 ] |
|
> Is there any parameter / variable in MariaDB configuration that can control explain complexity and prevent the database server from crashing when such a kind of query is invoked by some user? Not that I could easily identify. Making whatever `x5402_id_etapa` = '643' equates to at the low level being an index lookup might help. I'm curious as to where the patten of making a subquery in the FROM clause and then doing a `SELECT *` comes form. I don't think changing it will help, but it does look like an overly verbose way to write the query. |
| Comment by Martin Roman [ 2020-11-09 ] |
|
The pattern you're referring to is coming from our PHP framework:
Let me summarize your recommendations:
|
| Comment by Daniel Black [ 2020-11-16 ] |
|
Ack on query generation. My request for decreasing nesting levels was trying to get to a repeatable test case. I don't know if it will help avoid this crash or not. A latest test against 10.4 would at least help validate if this issue has already been solved. Upload your datadir with mariadb stopped to https://mariadb.com/kb/en/meta/mariadb-ftp-server/ if you have troubles doing this test yourself and are willing to share data with developers only to test. If a later 10.4 fixes this issue then maybe its worth testing to see if the stability is what you expect. Correct, about being no work arounds. |
| Comment by Martin Roman [ 2020-11-16 ] |
|
In the meantime we've migrated the entire database onto another server with the same MariaDB version installed. On the new instance the query is running fine with no issues. Interesting fact is that since we've dropped the problematic database, the original MariaDB instance is responding much faster. This is strange because there wasn't high traffic on that db. Is there any possibility that the problem would be caused by some integrity problem on a storage or by similar issue connected to on how the database is stored on the disk? The problem looks to be solved for now but we'll consider upgrade anyway. |
| Comment by Daniel Black [ 2020-11-16 ] |
|
Given the crash is the a part of the optimizer I say is reasonably less likely to be a storage problem, but its very hard to rule it out entirely. response time - check you have either skip-name-resolve or if dns is the issue. Optimizer trace may show query differences https://mariadb.com/kb/en/optimizer-trace-overview. Hard to say. There's quite a few ways to look through causes, but its a bit beyond scope for this issue. Best wishes for your upgrade. |
| Comment by Martin Roman [ 2020-11-21 ] |
|
It looks that the migration of the db on another server fixed the issue. Everything is running fine now withou any issues. We'll investigate on performance issues but it is another story. Let's close this. Thanks for your insights. |
| Comment by Daniel Black [ 2020-11-23 ] |
|
Thanks for the feedback. |