Marko Mäkelä
aa719b5010
MDEV-32050: Do not copy undo records in purge
...
Also, default to innodb_purge_batch_size=1000,
replacing the old default value of processing 300 undo log pages
in a batch. Axel Schwenke found this value to help reduce purge lag
without having a significant impact on workload throughput.
In purge, we can simply acquire a shared latch on the undo log page
(to avoid a race condition like the one that was fixed in
commit b102872ad5 ) and retain a buffer-fix
after releasing the latch. The buffer-fix will prevent the undo log
page from being evicted from the buffer pool. Concurrent modification
is prevented by design. Only the purge_coordinator_task
(or its accomplice purge_truncation_task) may free the undo log pages,
after any purge_worker_task have completed execution. Hence, we do not
have to worry about any overwriting or reuse of the undo log records.
trx_undo_rec_copy(): Remove. The only remaining caller would have been
trx_undo_get_undo_rec_low(), which is where the logic was merged.
purge_sys_t::m_initialized: Replaces heap.
purge_sys_t::pages: A cache of buffer-fixed pages that have been
looked up from buf_pool.page_hash.
purge_sys_t::get_page(): Return a buffer-fixed undo page, using the
pages cache.
trx_purge_t::batch_cleanup(): Renamed from clone_end_view().
Clear the pages cache and clone the end_view at the end of a batch.
purge_sys_t::n_pages_handled(): Return pages.size(). This determines
if innodb_purge_batch_size was exceeded.
purge_sys_t::rseg_get_next_history_log(): Replaces
trx_purge_rseg_get_next_history_log().
purge_sys_t::choose_next_log(): Replaces trx_purge_choose_next_log()
and trx_purge_read_undo_rec().
purge_sys_t::get_next_rec(): Replaces trx_purge_get_next_rec()
and trx_undo_get_next_rec().
purge_sys_t::fetch_next_rec(): Replaces trx_purge_fetch_next_rec()
and some use of trx_undo_get_first_rec().
trx_purge_attach_undo_recs(): Do not allow purge_sys.n_pages_handled()
exceed the innodb_purge_batch_size or ¾ of the buffer pool, whichever
is smaller.
Reviewed by: Vladislav Lesin
Tested by: Matthias Leich and Axel Schwenke
2023-10-25 10:19:17 +03:00
..
2018-10-10 18:30:42 +03:00
2020-03-16 10:10:33 +02:00
2023-04-04 16:05:55 +04:00
2019-09-01 19:17:35 +03:00
2019-09-01 19:17:35 +03:00
2021-02-03 02:22:47 +02:00
2023-05-02 23:37:10 +03:00
2019-09-28 19:21:14 +02:00
2020-03-18 12:50:17 +04:00
2019-09-03 13:17:32 +03:00
2020-03-17 19:08:28 +04:00
2020-03-17 19:08:28 +04:00
2020-03-17 19:08:28 +04:00
2020-03-17 11:09:19 +04:00
2021-05-17 12:48:37 +05:30
2021-05-10 09:36:40 +05:30
2020-03-17 19:08:28 +04:00
2020-03-17 11:09:19 +04:00
2020-03-18 12:50:17 +04:00
2019-09-11 15:09:35 +05:30
2020-03-17 19:08:28 +04:00
2019-09-03 13:17:32 +03:00
2020-03-17 19:08:28 +04:00
2021-05-19 06:48:36 +02:00
2021-05-19 06:48:36 +02:00
2021-05-19 06:48:36 +02:00
2021-05-19 06:48:36 +02:00
2021-05-19 06:48:36 +02:00
2022-09-20 16:53:20 +03:00
2021-05-19 06:48:36 +02:00
2021-05-19 06:48:36 +02:00
2021-05-19 06:48:36 +02:00
2021-05-19 06:48:36 +02:00
2022-09-20 16:53:20 +03:00
2021-05-19 06:48:36 +02:00
2021-05-19 06:48:36 +02:00
2021-05-19 06:48:36 +02:00
2022-09-20 16:53:20 +03:00
2021-05-19 06:48:36 +02:00
2022-09-20 16:53:20 +03:00
2020-03-17 14:27:52 +04:00
2020-01-21 11:22:47 +01:00
2023-02-03 16:27:16 +02:00
2019-12-21 10:34:02 +01:00
2022-09-12 22:10:39 +04:00
2019-09-11 08:48:00 +03:00
2020-03-17 14:27:52 +04:00
2020-10-29 15:16:53 +01:00
2021-05-10 09:36:40 +05:30
2020-03-17 19:08:28 +04:00
2022-09-14 16:24:51 +04:00
2022-09-14 16:24:51 +04:00
2020-03-17 14:27:52 +04:00
2020-08-25 10:15:04 +03:00
2019-12-06 18:51:05 +04:00
2022-05-15 23:28:06 +04:00
2020-03-18 17:14:07 +04:00
2020-03-18 17:14:07 +04:00
2020-03-18 20:16:34 +04:00
2020-03-18 17:14:07 +04:00
2020-03-18 17:14:07 +04:00
2023-07-30 22:00:43 +02:00
2020-03-18 20:16:34 +04:00
2020-03-18 17:14:07 +04:00
2020-03-18 17:14:07 +04:00
2019-09-06 11:53:10 +02:00
2019-02-18 13:37:57 +03:00
2020-02-05 15:34:02 +01:00
2021-01-25 18:41:27 +02:00
2021-03-18 08:02:48 +01:00
2020-03-17 14:27:52 +04:00
2020-03-18 07:11:18 +04:00
2019-09-01 19:17:35 +03:00
2019-04-01 19:47:24 +03:00
2019-04-01 19:47:24 +03:00
2022-03-23 16:42:43 +02:00
2020-11-11 11:15:11 +02:00
2019-12-13 17:30:37 +02:00
2022-02-09 08:36:41 +02:00
2019-09-09 18:18:52 +03:00
2021-03-11 20:09:34 +02:00
2020-11-11 11:15:11 +02:00
2020-04-01 11:34:32 +02:00
2020-04-01 11:34:32 +02:00
2021-05-19 22:54:13 +02:00
2018-07-04 19:13:55 +02:00
2021-02-20 11:58:58 +02:00
2020-11-04 16:55:36 +02:00
2022-02-24 22:41:23 +05:30
2018-11-06 08:41:48 +02:00
2018-11-06 08:41:48 +02:00
2019-05-08 12:49:08 +05:30
2019-05-08 12:49:08 +05:30
2022-02-24 22:41:23 +05:30
2020-03-30 14:50:23 +03:00
2020-04-01 11:34:32 +02:00
2021-07-01 10:31:08 +03:00
2020-10-26 17:09:01 +02:00
2020-10-15 17:04:56 +03:00
2020-10-26 17:09:01 +02:00
2020-04-01 11:34:32 +02:00
2023-10-25 10:19:17 +03:00
2023-10-25 09:11:58 +03:00
2018-07-04 19:13:55 +02:00
2019-12-10 17:01:36 +02:00
2021-08-31 13:55:02 +03:00
2020-04-01 11:34:32 +02:00
2020-04-25 21:57:52 +03:00
2020-04-01 11:34:32 +02:00
2021-10-26 00:29:27 +04:00
2019-09-01 19:17:35 +03:00
2019-09-01 19:17:35 +03:00
2019-09-01 19:17:35 +03:00
2022-07-06 15:42:21 +04:00
2020-03-03 13:12:43 +02:00
2020-03-17 19:08:28 +04:00
2020-03-17 19:08:28 +04:00
2022-07-06 15:42:21 +04:00
2020-03-17 19:08:28 +04:00
2023-10-03 08:25:31 +03:00
2019-09-01 19:17:35 +03:00
2022-07-06 15:42:21 +04:00
2020-03-18 13:27:38 +04:00
2019-09-01 19:17:35 +03:00
2019-09-01 19:17:35 +03:00
2020-03-17 19:08:28 +04:00
2020-03-17 19:08:28 +04:00
2020-03-17 19:08:28 +04:00
2019-09-03 13:17:32 +03:00
2020-03-17 14:27:52 +04:00
2019-09-03 13:17:32 +03:00
2020-03-17 14:27:52 +04:00
2019-09-01 19:17:35 +03:00
2020-03-17 14:27:52 +04:00
2019-09-06 11:53:10 +02:00
2020-12-10 08:45:20 +01:00
2018-06-20 17:14:04 +04:00
2023-05-24 19:22:08 +03:00
2021-03-04 22:50:00 +05:30
2020-02-13 13:42:01 +02:00
2021-05-19 06:48:36 +02:00
2020-04-01 11:34:32 +02:00
2023-10-19 17:24:30 +03:00
2020-04-01 11:34:32 +02:00
2020-03-18 20:16:34 +04:00
2020-03-17 14:27:52 +04:00
2020-03-18 07:11:18 +04:00
2020-03-17 12:44:06 +04:00
2020-03-17 12:44:06 +04:00
2019-09-01 19:17:35 +03:00
2020-03-18 11:57:07 +04:00
2020-03-18 11:57:07 +04:00
2020-10-23 12:20:17 +04:00
2020-03-18 07:11:18 +04:00
2020-03-18 07:11:18 +04:00
2020-03-18 07:11:18 +04:00
2020-03-18 07:11:18 +04:00
2019-08-05 16:03:33 +04:00
2020-03-18 07:11:18 +04:00
2020-03-18 07:11:18 +04:00
2020-03-18 07:11:18 +04:00
2020-10-28 10:56:38 +01:00
2020-03-18 10:36:06 +04:00
2020-03-18 10:36:06 +04:00
2020-03-18 10:36:06 +04:00
2020-03-18 10:36:06 +04:00
2020-03-18 10:36:06 +04:00
2020-03-18 10:36:06 +04:00
2020-03-18 10:36:06 +04:00
2020-03-18 10:36:06 +04:00
2020-03-18 10:36:06 +04:00
2020-03-17 14:27:52 +04:00
2018-07-04 19:13:55 +02:00
2020-03-23 17:47:06 +04:00
2020-03-23 17:47:06 +04:00
2020-03-23 17:47:06 +04:00
2020-03-23 17:47:06 +04:00
2020-03-18 20:16:34 +04:00
2020-10-30 11:15:30 +02:00
2022-07-06 15:42:21 +04:00
2020-03-18 07:11:18 +04:00
2020-03-18 07:11:18 +04:00
2020-03-18 07:11:18 +04:00
2020-03-18 07:11:18 +04:00
2020-03-18 07:11:18 +04:00
2020-03-18 07:11:18 +04:00
2020-03-18 07:11:18 +04:00
2020-03-18 07:11:18 +04:00
2020-03-18 07:11:18 +04:00
2020-03-18 07:11:18 +04:00
2020-03-18 07:11:18 +04:00
2020-03-18 07:11:18 +04:00
2019-06-30 18:52:45 +09:00
2020-03-18 07:11:18 +04:00
2020-03-18 07:11:18 +04:00
2020-03-17 14:27:52 +04:00
2019-12-06 18:51:05 +04:00
2020-03-17 11:09:19 +04:00
2018-11-06 08:41:48 +02:00
2018-11-26 08:10:47 +04:00
2022-09-12 22:10:39 +04:00
2020-02-13 13:42:01 +02:00
2021-07-15 16:27:31 +07:00
2019-09-03 13:17:32 +03:00
2020-03-17 19:08:28 +04:00
2020-03-18 11:57:07 +04:00
2020-03-18 11:57:07 +04:00
2020-03-18 11:57:07 +04:00
2023-07-20 11:54:52 +02:00
2023-07-20 11:54:52 +02:00
2023-02-03 16:27:16 +02:00
2023-10-25 10:19:17 +03:00
2023-10-25 10:19:17 +03:00
2023-10-03 08:25:31 +03:00
2023-10-19 17:24:30 +03:00
2023-10-03 08:25:31 +03:00
2021-06-16 15:44:18 +10:00
2023-10-19 17:24:30 +03:00
2022-09-14 19:59:05 +02:00
2023-01-17 10:03:05 +02:00
2019-09-03 13:17:32 +03:00
2020-08-10 11:58:56 +02:00
2018-08-12 00:13:19 +01:00
2020-03-17 14:27:52 +04:00
2020-03-17 14:27:52 +04:00
2020-03-17 14:27:52 +04:00
2018-10-12 08:22:10 +02:00
2019-05-31 15:04:11 +02:00
2020-03-17 14:27:52 +04:00
2019-03-06 15:12:11 +01:00
2022-04-12 01:22:51 +05:30
2019-09-28 19:21:14 +02:00
2020-08-25 10:15:04 +03:00
2018-12-09 13:25:27 +05:30
2019-09-01 19:17:35 +03:00
2021-12-27 13:28:25 +01:00
2020-10-05 10:34:01 +03:00
2021-01-21 11:41:29 +02:00
2019-02-13 13:19:37 +02:00
2021-04-20 08:24:14 +03:00
2023-05-12 02:48:16 +02:00
2019-01-26 01:15:44 +01:00