summaryrefslogtreecommitdiff
path: root/storage/innobase/include
diff options
context:
space:
mode:
authorThirunarayanan Balathandayuthapani <thiru@mariadb.com>2020-03-23 16:37:44 +0530
committerThirunarayanan Balathandayuthapani <thiru@mariadb.com>2020-03-23 16:41:48 +0530
commit6697135c6d03935118c3dfa1c97faea7fa76afa6 (patch)
treef9896818863ef09cbe20515296a43a33d5026a33 /storage/innobase/include
parent1e6be6938059d230903029fa99ad6504c53d90ea (diff)
downloadmariadb-git-6697135c6d03935118c3dfa1c97faea7fa76afa6.tar.gz
MDEV-21572 buf_page_get_gen() should apply buffered page initialized
redo log during recovery - InnoDB unnecessarily reads the page even though it has fully initialized buffered redo log records. Allow the page initialization redo log to apply for the page in buf_page_get_gen() during recovery. - Renamed buf_page_get_gen() to buf_page_get_low() - Newly added buf_page_get_gen() will check for buffered redo log for the particular page id during recovery - Added new function buf_page_mtr_lock() which basically latches the page for the given latch type. - recv_recovery_create_page() is inline function which creates a page if it has page initialization redo log records.
Diffstat (limited to 'storage/innobase/include')
-rw-r--r--storage/innobase/include/buf0buf.h24
-rw-r--r--storage/innobase/include/log0recv.h18
2 files changed, 42 insertions, 0 deletions
diff --git a/storage/innobase/include/buf0buf.h b/storage/innobase/include/buf0buf.h
index a04936a19cf..d120dc36091 100644
--- a/storage/innobase/include/buf0buf.h
+++ b/storage/innobase/include/buf0buf.h
@@ -436,6 +436,7 @@ buf_page_get_zip(
const page_size_t& page_size);
/** This is the general function used to get access to a database page.
+It does page initialization and applies the buffered redo logs.
@param[in] page_id page id
@param[in] rw_latch RW_S_LATCH, RW_X_LATCH, RW_NO_LATCH
@param[in] guess guessed block or NULL
@@ -458,6 +459,29 @@ buf_page_get_gen(
mtr_t* mtr,
dberr_t* err);
+/** This is the low level function used to get access to a database page.
+@param[in] page_id page id
+@param[in] rw_latch RW_S_LATCH, RW_X_LATCH, RW_NO_LATCH
+@param[in] guess guessed block or NULL
+@param[in] mode BUF_GET, BUF_GET_IF_IN_POOL,
+BUF_PEEK_IF_IN_POOL, BUF_GET_NO_LATCH, or BUF_GET_IF_IN_POOL_OR_WATCH
+@param[in] file file name
+@param[in] line line where called
+@param[in] mtr mini-transaction
+@param[out] err DB_SUCCESS or error code
+@return pointer to the block or NULL */
+buf_block_t*
+buf_page_get_low(
+ const page_id_t page_id,
+ const page_size_t& page_size,
+ ulint rw_latch,
+ buf_block_t* guess,
+ ulint mode,
+ const char* file,
+ unsigned line,
+ mtr_t* mtr,
+ dberr_t* err);
+
/** Initializes a page to the buffer buf_pool. The page is usually not read
from a file even if it cannot be found in the buffer buf_pool. This is one
of the functions which perform to a block a state transition NOT_USED =>
diff --git a/storage/innobase/include/log0recv.h b/storage/innobase/include/log0recv.h
index 068d7813c20..b91312e81e2 100644
--- a/storage/innobase/include/log0recv.h
+++ b/storage/innobase/include/log0recv.h
@@ -342,4 +342,22 @@ times! */
roll-forward */
#define RECV_SCAN_SIZE (4 * UNIV_PAGE_SIZE)
+/** This is a low level function for the recovery system
+to create a page which has buffered intialized redo log records.
+@param[in] page_id page to be created using redo logs
+@return whether the page creation successfully */
+buf_block_t* recv_recovery_create_page_low(const page_id_t page_id);
+
+/** Recovery system creates a page which has buffered intialized
+redo log records.
+@param[in] page_id page to be created using redo logs
+@return block which contains page was initialized */
+inline buf_block_t* recv_recovery_create_page(const page_id_t page_id)
+{
+ if (UNIV_LIKELY(!recv_recovery_on))
+ return NULL;
+
+ return recv_recovery_create_page_low(page_id);
+}
+
#endif