mariadb/storage
Marko Mäkelä e8b7fceb82 MDEV-24302: RESET MASTER hangs
Starting with MariaDB 10.5, roughly after MDEV-23855 was fixed,
we are observing sporadic hangs during the execution of the
RESET MASTER statement. We are hoping to fix the hangs with these
changes, but due to the rather infrequent occurrence of the hangs
and our inability to reliably reproduce the hangs, we cannot be
sure of this.

What we do know is that innodb_force_recovery=2 (or a larger setting)
will prevent srv_master_callback (the former srv_master_thread) from
running. In that mode, periodic log flushes would never occur and
RESET MASTER could hang indefinitely. That is demonstrated by the new
test case that was developed by Andrei Elkin. We fix this case by
implementing a special case for it.

This also includes some code cleanup and renames of misleadingly
named code. The interface has nothing to do with log checkpoints in
the storage engine; it is only about requesting log writes to be
persistent.

handlerton::commit_checkpoint_request,
commit_checkpoint_notify_ha(): Remove the unused parameter hton.

log_requests.start: Replaces pending_checkpoint_list.
log_requests.end: Replaces pending_checkpoint_list_end.
log_requests.mutex: Replaces pending_checkpoint_mutex.

log_flush_notify_and_unlock(), log_flush_notify(): Replaces
innobase_mysql_log_notify().  The new implementation should be
functionally equivalent to the old one.

innodb_log_flush_request(): Replaces innobase_checkpoint_request().
Implement a fast path for common cases, and reduce the mutex hold time.
POSSIBLE FIX OF THE HANG: We will invoke commit_checkpoint_notify_ha()
for the current request if it is already satisfied, as well as invoke
log_flush_notify_and_unlock() for any satisfied requests.

log_write(): Invoke log_flush_notify() when the write is already durable.
This was missing WITH_PMEM when the log is in persistent memory.

Reviewed by: Vladislav Vaintroub
2021-03-29 15:16:23 +03:00
..
archive Merge branch 'bb-10.4-release' into bb-10.5-release 2021-02-15 16:43:15 +01:00
blackhole Merge 10.3 into 10.4 2020-11-03 14:49:17 +02:00
cassandra Merge branch 'bb-10.4-release' into bb-10.5-release 2021-02-15 16:43:15 +01:00
columnstore columnstore 5.5.1-2 2021-02-15 16:44:37 +01:00
connect Fix various spelling errors still found in code 2021-03-22 18:10:39 +11:00
csv Merge branch 'bb-10.4-release' into bb-10.5-release 2021-02-15 16:43:15 +01:00
example
federated Fix various spelling errors still found in code 2021-03-22 18:10:39 +11:00
federatedx Fix various spelling errors still found in code 2021-03-22 18:10:39 +11:00
heap Fix various spelling errors still found in code 2021-03-22 18:10:39 +11:00
innobase MDEV-24302: RESET MASTER hangs 2021-03-29 15:16:23 +03:00
maria Fix various spelling errors still found in code 2021-03-22 18:10:39 +11:00
mroonga Merge 10.4 into 10.5 2021-03-05 12:54:43 +02:00
myisam Fix various spelling errors still found in code 2021-03-22 18:10:39 +11:00
myisammrg Added 'final' to some classes to improve generated code 2020-08-04 17:27:32 +02:00
oqgraph Merge branch 'bb-10.4-release' into bb-10.5-release 2021-02-15 16:43:15 +01:00
perfschema Merge remote-tracking branch 'origin/10.4' into 10.5 2021-02-26 13:23:13 +11:00
rocksdb MDEV-24302: RESET MASTER hangs 2021-03-29 15:16:23 +03:00
sequence Merge branch 'bb-10.4-release' into bb-10.5-release 2021-02-15 16:43:15 +01:00
sphinx Merge branch 'bb-10.4-release' into bb-10.5-release 2021-02-15 16:43:15 +01:00
spider Merge branch 'bb-10.4-release' into bb-10.5-release 2021-02-15 16:43:15 +01:00
test_sql_discovery MDEV-19632 Replication aborts with ER_SLAVE_CONVERSION_FAILED upon CREATE ... SELECT in ORACLE mode 2020-08-01 07:43:50 +04:00
tokudb Fix various spelling errors still found in code 2021-03-22 18:10:39 +11:00