[MDEV-24163] Mariadb is restarting after sending this message [Warning] Aborted connection 5889 to db: 'xxxx' user: 'xxxxx' host: Created: 2020-11-08 Updated: 2021-03-25 Resolved: 2020-11-11 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Optimizer |
| Affects Version/s: | 10.3.26, 10.5.7 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Minor |
| Reporter: | Lucía | Assignee: | Daniel Black |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | notifications, phpbb | ||
| Environment: |
PhpBB 3.3 interacting with mariadb |
||
| Attachments: |
|
||||||||
| Issue Links: |
|
||||||||
| Description |
|
After updating to either version from 10.5.x and 10.3.25 respectively, two different users of phpBB board started getting errors and journal registered mariadb restarting with the following message:
The backtrace in phpBB is:
This didn’t happened in previous versions of mariadb. I decided to keep 10.5.7 with email disabled and the other user downgraded to mariadb 10.3.25. This is the thread where we discussed it https://www.phpbb.com/community/viewtopic.php?f=661&t=2573166 |
| Comments |
| Comment by Daniel Black [ 2020-11-08 ] | ||||
|
lbartolome thanks for the bug report. I'm not sure why you marked On the summary you've provided it possibly more likely to be | ||||
| Comment by Lucía [ 2020-11-09 ] | ||||
|
Hi @daniel black, this error happened the day before the other error, so I wasn't sure whether this one helped triggered the other one later. By the way, I'm using php 7.4. | ||||
| Comment by stuart marritt [ 2020-11-10 ] | ||||
|
Hi The above report is a copy and a link to my post on phpBB I can confirm that the php version was 7.4 This issue was causing a huge memory spike on my server and crashing the database! Oddly turning off board wide emails solved the issue but that's not the solution | ||||
| Comment by Daniel Black [ 2020-11-11 ] | ||||
|
Thanks for confirming the PHP version which rules out The query, memory exhaustion and the revert fixing it would likely indicate If you could confirm after the release that this corrects the problem that would be appreciated. It it doesn't, can you include:
Aside if https://github.com/phpbb/phpbb/blob/master/phpBB/phpbb/db/migration/data/v33x/add_notification_emails_table.php#L41 is the structure, the PK order should be [notification_type_id , user_id, item_parent_id, item_id] at least for this query. A DELETE ... RETURNING syntax would probably make the retrieval and delete in the same step work well in phpbb but its hard with multiple DB vendors of different capabilities and coding to the highest common denominator is needed. I sincerely hope the forth coming update to | ||||
| Comment by Daniel Black [ 2020-11-11 ] | ||||
|
Well, https://mariadb.org/mariadb-10-5-8-10-4-17-10-3-27-and-10-2-36-now-available/ is out. This corrects the memory usage of processing of long lists described in | ||||
| Comment by Charlie Ciccia [ 2021-03-24 ] | ||||
|
exact issue reported above (with the same table and all) is occurring on 10.5.9 (crash output attached). I am using the mariadb:10.5 docker image. I realize the IN clause is about 6500 elements along, and could probably work around this exact case by writing an extension to change how this query works in phpbb, but I worry about how many other landmines I haven't found yet. My phpbb_* tables are all using InnoDB engine. even attempting to EXPLAIN this query at the cli is also causing the crash. mariadb_crash.txt | ||||
| Comment by Charlie Ciccia [ 2021-03-25 ] | ||||
|
Daniel, the fix described in https://www.phpbb.com/community/viewtopic.php?p=15679676#p15679676 worked for me. Thank you. | ||||
| Comment by Daniel Black [ 2021-03-25 ] | ||||
|
Great. Glad you saw my notice there. https://www.phpbb.com/community/viewtopic.php?p=15624396#p15624396 might offer some tips how to write it better from my loose reading of the codebase. If you need a hand with suggested SQL feel free to ask on https://mariadb.zulipchat.com, https://dba.stackexchange.com/ or even https://stackoverflow.com. What MariaDB does need to process these ugly queries without crashing thanks for looking at better ways of doing this. I suspect looking at the core code implementation that generates this list and hows it used could show very portable ways of improving this. |