MDEV-24845 : Oddities around innodb_fatal_semaphore_wait_threshold and global.innodb_disallow_writes
We will remove variable innodb_disallow_writes because it is badly
designed and implemented. Parameter will be marked as removed.
Instead we will be using
* Galera provider is paused i.e. all commits will wait
* FLUSH TABLES WITH READ LOCK (FTWRL) to avoid any DDL during SST
* We set max_dirty_pages_pct to 0.0 to flush all dirty pages from buffer pool
* We force flushing all dirty pages from buffer pool and force InnoDB checkpoint
* We set max_dirty_pagec_pct to 99.9 to avoid flushing any pages
* We set server to read-only
* Encryption, purge and FTS-optimize threads will acquire MDL_BACKUP_DML
before continuing. This will conflict with lock acquired in FTWRL.
Note that we will not use waiting. If MDL-lock can't be acquired
we will skip the operation.
xtrabackup.cc
Remove INNODB_DISALLOW_WRITES code
handler.cc
handler.h
Add new API function ha_force_checkpoint to force checkpoint
inside InnoDB.
mysqld.cc
Mark innodb-disallow-writes variable as removed.
sql_class.cc
New functions to get and release backup lock.
wsrep_sst.cc
Add functions to set innodb_max_dirty_pages_pct,
innodb_max_dirty_pages_pct_lwm and read_only.
We set them as 0.0 and then call new API function
to force buffer pool flush and full checkpoint.
After it has finished, we set them as 99.9.
fil0crypt.cc
fil_crypt_start_encrypting_space()
fil_crypt_thread()
Acquire backup lock and release it afte we have done
fts0opt.cc
fts_optimize_sync_table()
fts_optimize_callback()
Acquire backup lock and release it afte we have done
ha_innodb.cc
Remove all WITH_INNODB_DISALLOW_WRITES code
wsrep_force_checkpoint()
New API function to flush dirty pages from buffer pool and
force full checkpoint.
trx_purge,cc
trx_purge()
Acquire and release global MDL_BACKUP_DML lock
The test innodb.log_file_size would occasionally crash in
a debug assertion failure in srv_prepare_to_delete_redo_log_file().
In the core dump, the assertion would hold.
buf_pool_t::any_io_pending(): Avoid dirty reads by acquiring
buf_pool.mutex. This function is only being invoked in debug builds,
so we do not care about any performance impact.