[MDEV-25975] Turning on innodb_disallow_writes will cause mysqladmin shutdown to hang Created: 2021-06-21 Updated: 2022-04-07 Resolved: 2022-04-06 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Locking, Storage Engine - InnoDB |
| Affects Version/s: | 10.2, 10.3, 10.4, 10.5, 10.6, 10.7 |
| Fix Version/s: | 10.3.35, 10.4.25, 10.5.16, 10.6.8, 10.7.4, 10.8.3, 10.9.1 |
| Type: | Bug | Priority: | Major |
| Reporter: | Roel Van de Paar | Assignee: | Marko Mäkelä |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | Memory_leak, affects-tests, hang, lock | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||
| Description |
|
(No other SQL is required and innodb_fast_shutdown=1) Will cause mysqladmin shutdown to hang, on debug and optimized builds alike. |
| Comments |
| Comment by Roel Van de Paar [ 2021-06-21 ] | |||||||||||||||||||||||||||||||||||||||
|
While mysqladmin shutdown will hang, a SHUTDOWN command issued at the client will not hang (expected as SHUTDOWN does not wait for shutdown to finalized), but the PID will still be live for an undefined amount of time. This is an additional concern as an automatic restart will run into issues.
Leads to:
| |||||||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2021-06-21 ] | |||||||||||||||||||||||||||||||||||||||
|
I think that the parameter is implemented incorrectly. The correct implementation would be to block anything that would write something, at the highest possible level. Already in log_free_check() it is too late, because that function is not allowed to return any error, only delay the execution. A proper design should be something like this:
| |||||||||||||||||||||||||||||||||||||||
| Comment by Roel Van de Paar [ 2021-06-21 ] | |||||||||||||||||||||||||||||||||||||||
|
Additionally, using the test case in my previous comment above, there is a 'Memory not freed' issue in 10.3;
10.4.20 and 10.5.11 show the Aria SE issue also, but not the 'Memory not freed' issue. Same result for InnnoDB.
10.2 Does not show the Aria issue nor the 'Memory not freed' issue but initiates a crash recovery:
| |||||||||||||||||||||||||||||||||||||||
| Comment by Roel Van de Paar [ 2021-11-05 ] | |||||||||||||||||||||||||||||||||||||||
|
I am also seeing this:
And was able to reduce the testcase for "ha_innodb.cc, line 19471, when the mutex was already locked at /test/10.7_dbg/sql/sys_vars_shared.h, line 56" in the error log to the following (not all statements may be required, the issue
Attempts to reproduce the mutex note using CLI have | |||||||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2022-03-30 ] | |||||||||||||||||||||||||||||||||||||||
|
Please test and review the following: This differs from what you submitted for my review in In 10.3 and 10.4, we will also keep the dict_stats_thread running, but disable it by checking a global variable. That is not properly locked (just like the check in fts_optimize_task or fts_optimize_thread is not), but hopefully during the time spent on log_make_checkpoint() the writes will be paused. | |||||||||||||||||||||||||||||||||||||||
| Comment by Matthias Leich [ 2022-04-05 ] | |||||||||||||||||||||||||||||||||||||||
|
| |||||||||||||||||||||||||||||||||||||||
| Comment by Jan Lindström (Inactive) [ 2022-04-05 ] | |||||||||||||||||||||||||||||||||||||||
|
Ok to push | |||||||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2022-04-06 ] | |||||||||||||||||||||||||||||||||||||||
|
The variable innodb_disallow_writes was removed. |