summaryrefslogtreecommitdiff
path: root/storage/innobase/include/trx0undo.h
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2020-02-19 10:58:04 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2020-02-19 15:52:16 +0200
commit86f262f1c7dbd7d1c3b3bc6b5aa7b494c962a18c (patch)
tree43240e4312acba3dae83c74aabc2b17e6dba81fa /storage/innobase/include/trx0undo.h
parent3ee100b0d1db5c64d1227756c9fc2797f7e6ec7f (diff)
downloadmariadb-git-86f262f1c7dbd7d1c3b3bc6b5aa7b494c962a18c.tar.gz
MDEV-12353: Reduce log volume by an UNDO_INIT record
We introduce an EXTENDED log record for initializing an undo log page. The size of the record will be 2 bytes plus the optional page identifier. The entire undo page will be initialized, except the space that is already reserved for TRX_UNDO_SEG_HDR in trx_undo_seg_create(). mtr_t::undo_create(): Write the UNDO_INIT record. trx_undo_page_init(): Initialize the undo page corresponding to the UNDO_INIT record. Unlike the former MLOG_UNDO_INIT record, we will initialize almost the entire page, including initializing the TRX_UNDO_PAGE_NODE to an empty list node, so that the subsequent call to flst_init() will avoid writing log for the undo page.
Diffstat (limited to 'storage/innobase/include/trx0undo.h')
-rw-r--r--storage/innobase/include/trx0undo.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/storage/innobase/include/trx0undo.h b/storage/innobase/include/trx0undo.h
index b68f34ff4da..37421930b9b 100644
--- a/storage/innobase/include/trx0undo.h
+++ b/storage/innobase/include/trx0undo.h
@@ -156,6 +156,13 @@ trx_undo_get_first_rec(const fil_space_t &space, uint32_t page_no,
uint16_t offset, ulint mode, buf_block_t*& block,
mtr_t *mtr);
+/** Initialize an undo log page.
+NOTE: This corresponds to a redo log record and must not be changed!
+@see mtr_t::undo_create()
+@param[in,out] block undo log page */
+void trx_undo_page_init(const buf_block_t &block)
+ MY_ATTRIBUTE((nonnull));
+
/** Allocate an undo log page.
@param[in,out] undo undo log
@param[in,out] mtr mini-transaction that does not hold any page latch