mariadb/storage/innobase
Marko Mäkelä a3d0d5fc33 MDEV-26055: Improve adaptive flushing
This is a 10.5 backport from 10.6
commit 9593cccf28.

Adaptive flushing is enabled by setting innodb_max_dirty_pages_pct_lwm>0
(not default) and innodb_adaptive_flushing=ON (default).
There is also the parameter innodb_adaptive_flushing_lwm
(default: 10 per cent of the log capacity). It should enable some
adaptive flushing even when innodb_max_dirty_pages_pct_lwm=0.
That is not being changed here.

This idea was first presented by Inaam Rana several years ago,
and I discussed it with Jean-François Gagné at FOSDEM 2023.

buf_flush_page_cleaner(): When we are not near the log capacity limit
(neither buf_flush_async_lsn nor buf_flush_sync_lsn are set),
also try to move clean blocks from the buf_pool.LRU list to buf_pool.free
or initiate writes (but not the eviction) of dirty blocks, until
the remaining I/O capacity has been consumed.

buf_flush_LRU_list_batch(): Add the parameter bool evict, to specify
whether dirty least recently used pages (from buf_pool.LRU) should
be evicted immediately after they have been written out. Callers outside
buf_flush_page_cleaner() will pass evict=true, to retain the existing
behaviour.

buf_do_LRU_batch(): Add the parameter bool evict.
Return counts of evicted and flushed pages.

buf_flush_LRU(): Add the parameter bool evict.
Assume that the caller holds buf_pool.mutex and
will invoke buf_dblwr.flush_buffered_writes() afterwards.

buf_flush_list_holding_mutex(): A low-level variant of buf_flush_list()
whose caller must hold buf_pool.mutex and invoke
buf_dblwr.flush_buffered_writes() afterwards.

buf_flush_wait_batch_end_acquiring_mutex(): Remove. It is enough to have
buf_flush_wait_batch_end().

page_cleaner_flush_pages_recommendation(): Avoid some floating-point
arithmetics.

buf_flush_page(), buf_flush_check_neighbor(), buf_flush_check_neighbors(),
buf_flush_try_neighbors(): Rename the parameter "bool lru" to "bool evict".

buf_free_from_unzip_LRU_list_batch(): Remove the parameter.
Only actual page writes will contribute towards the limit.

buf_LRU_free_page(): Evict freed pages of temporary tables.

buf_pool.done_free: Broadcast whenever a block is freed
(and buf_pool.try_LRU_scan is set).

buf_pool_t::io_buf_t::reserve(): Retry indefinitely.
During the test encryption.innochecksum we easily run out of
these buffers for PAGE_COMPRESSED or ENCRYPTED pages.

Tested by Matthias Leich and Axel Schwenke
2023-11-16 17:45:18 +02:00
..
btr Merge commit '10.4' into 10.5 2023-07-20 11:54:52 +02:00
buf MDEV-26055: Improve adaptive flushing 2023-11-16 17:45:18 +02:00
data Merge 10.4 into 10.5 2022-10-25 11:26:37 +03:00
dict MDEV-30936 clang 15.0.7 -fsanitize=memory fails massively 2023-03-28 11:44:24 +03:00
eval
fil Merge branch '10.4' into 10.5 2023-11-08 12:59:00 +01:00
fsp MDEV-32757 innodb_undo_log_truncate=ON is not crash safe 2023-11-15 12:23:35 +02:00
fts Merge branch '10.4' into 10.5 2023-11-08 12:59:00 +01:00
fut
gis Merge 10.4 into 10.5 2022-10-25 11:26:37 +03:00
ha
handler Merge branch '10.4' into 10.5 2023-11-08 12:59:00 +01:00
ibuf MDEV-32132 DROP INDEX followed by CREATE INDEX may corrupt data 2023-09-08 11:28:21 +03:00
include MDEV-26055: Improve adaptive flushing 2023-11-16 17:45:18 +02:00
lock Merge branch '10.4' into 10.5 2023-11-08 12:59:00 +01:00
log Merge branch '10.5' into mariadb-10.5.23 2023-11-14 08:41:23 +01:00
mem Merge 10.4 into 10.5 2020-07-02 09:41:44 +03:00
mtr MDEV-32552 Write-ahead logging is broken for freed pages 2023-10-23 16:13:16 +03:00
mysql-test/storage_engine
os Merge branch '10.4' into 10.5 2023-09-25 13:06:57 +10:00
page Merge remote-tracking branch '10.4' into 10.5 2023-03-31 21:32:41 +02:00
pars Merge branch '10.4' into 10.5 2023-11-08 12:59:00 +01:00
que MDEV-30936 clang 15.0.7 -fsanitize=memory fails massively 2023-03-28 11:44:24 +03:00
read Merge branch '10.3' into 10.4 2021-07-31 22:59:58 +02:00
rem Fix WITH_UBSAN GCC -Wconversion 2023-06-28 17:07:00 +03:00
row Merge branch '10.4' into 10.5 2023-11-08 12:59:00 +01:00
srv MDEV-32798 innodb_fast_shutdown=0 hang after incomplete startup 2023-11-14 14:35:51 +02:00
sync Merge 10.4 into 10.5 2022-04-21 15:33:50 +03:00
trx MDEV-32757 innodb_undo_log_truncate=ON is not crash safe 2023-11-15 12:23:35 +02:00
unittest MDEV-19522 fixup: Use correct printf format 2021-10-21 15:53:35 +03:00
ut Cleanup: Say "mariadbd" instead of "mysqld" in InnoDB messages 2022-11-22 15:32:47 +02:00
.clang-format-old switch off storage/innobase/.clang-format: InnoDB uses a common formatting style for all new code 2021-03-17 11:01:15 +03:00
bzip2.cmake Add feature summary at the end of cmake. 2021-07-21 10:22:56 +03:00
CMakeLists.txt Merge branch '10.4' into 10.5 2023-11-08 12:59:00 +01:00
compile-innodb
COPYING.Google
COPYING.Percona
lz4.cmake Add feature summary at the end of cmake. 2021-07-21 10:22:56 +03:00
lzma.cmake Add feature summary at the end of cmake. 2021-07-21 10:22:56 +03:00
lzo.cmake Add feature summary at the end of cmake. 2021-07-21 10:22:56 +03:00
snappy.cmake Add feature summary at the end of cmake. 2021-07-21 10:22:56 +03:00