summaryrefslogtreecommitdiff
path: root/storage/innobase/include/fsp0fsp.h
diff options
context:
space:
mode:
authorThirunarayanan Balathandayuthapani <thiru@mariadb.com>2020-09-09 11:58:15 +0530
committerThirunarayanan Balathandayuthapani <thiru@mariadb.com>2020-09-09 11:58:15 +0530
commitb1009ae5c16697d5eef443cc6a60a74301148c73 (patch)
tree9e48295ece91aa6026406cdfa084542e9dbf9d1a /storage/innobase/include/fsp0fsp.h
parentf99cace77fbf3076137ba63b024465c6ab6ee25e (diff)
downloadmariadb-git-b1009ae5c16697d5eef443cc6a60a74301148c73.tar.gz
MDEV-23456 fil_space_crypt_t::write_page0() is accessing an uninitialized page
buf_page_create() is invoked when page is initialized. So that previous contents of the page ignored. In few cases, it calls buf_page_get_gen() is called to fetch the page from buffer pool. It should take x-latch on the page. If other thread uses the block or block io state is different from BUF_IO_NONE then release the mutex and check the state and buffer fix count again. For compressed page, use the existing free block from LRU list to create new page. Retry to fetch the compressed page if it is in flush list fseg_create(), fseg_create_general(): Introduce block as a parameter where segment header is placed. It is used to avoid repetitive x-latch on the same page Change the assert to check whether the page has SX latch and X latch in all callee function of buf_page_create() mtr_t::get_fix_count(): Get the buffer fix count of the given block added by the mtr FindBlock is added to find the buffer fix count of the given block acquired by the mini-transaction
Diffstat (limited to 'storage/innobase/include/fsp0fsp.h')
-rw-r--r--storage/innobase/include/fsp0fsp.h66
1 files changed, 38 insertions, 28 deletions
diff --git a/storage/innobase/include/fsp0fsp.h b/storage/innobase/include/fsp0fsp.h
index 8debdb00013..a50be6f8998 100644
--- a/storage/innobase/include/fsp0fsp.h
+++ b/storage/innobase/include/fsp0fsp.h
@@ -407,42 +407,52 @@ fsp_header_inc_size(
ulint space_id, /*!< in: space id */
ulint size_inc, /*!< in: size increment in pages */
mtr_t* mtr); /*!< in/out: mini-transaction */
-/**********************************************************************//**
-Creates a new segment.
+
+/** Creates a new segment.
+@param[in] space space id
+@param[in] byte_offset byte offset of the created segment header
+ on the page
+@param[in,out] mtr mini-transaction
+@param[in,out] block block where segment header is placed;
+ If it is null then new page will be
+ allocated and it will belong to
+ the created segment
@return the block where the segment header is placed, x-latched, NULL
if could not create segment because of lack of space */
buf_block_t*
fseg_create(
-/*========*/
- ulint space_id,/*!< in: space id */
- ulint page, /*!< in: page where the segment header is placed: if
- this is != 0, the page must belong to another segment,
- if this is 0, a new page will be allocated and it
- will belong to the created segment */
- ulint byte_offset, /*!< in: byte offset of the created segment header
- on the page */
- mtr_t* mtr); /*!< in/out: mini-transaction */
-/**********************************************************************//**
-Creates a new segment.
+ ulint space,
+ ulint byte_offset,
+ mtr_t* mtr,
+ buf_block_t* block=NULL);
+
+/** Creates a new segment.
+@param[in] space_id space_id
+@param[in] byte_offset byte offset of the created segment
+ header on the page
+@param[in] has_done_reservation TRUE if the caller has already
+ done the reservation for the pages
+ with fsp_reserve_free_externts
+ (at least 2 extents: one for
+ the inode and the other for the
+ segment) then there is no need to do
+ the check for this individual
+ operation
+@param[in,out] mtr mini-transaction
+@param[in] block block where the segment header is
+ placed. If it is null then new page
+ will be allocated and it will belong
+ to the created segment
@return the block where the segment header is placed, x-latched, NULL
if could not create segment because of lack of space */
buf_block_t*
fseg_create_general(
-/*================*/
- ulint space_id,/*!< in: space id */
- ulint page, /*!< in: page where the segment header is placed: if
- this is != 0, the page must belong to another segment,
- if this is 0, a new page will be allocated and it
- will belong to the created segment */
- ulint byte_offset, /*!< in: byte offset of the created segment header
- on the page */
- ibool has_done_reservation, /*!< in: TRUE if the caller has already
- done the reservation for the pages with
- fsp_reserve_free_extents (at least 2 extents: one for
- the inode and the other for the segment) then there is
- no need to do the check for this individual
- operation */
- mtr_t* mtr); /*!< in/out: mini-transaction */
+ ulint space_id,
+ ulint byte_offset,
+ ibool has_done_reservation,
+ mtr_t* mtr,
+ buf_block_t* block);
+
/**********************************************************************//**
Calculates the number of pages reserved by a segment, and how many pages are
currently used.