Commit ea25bdc1 authored by Marko Mäkelä's avatar Marko Mäkelä

Do not write MLOG_IBUF_BITMAP_INIT

Use ibuf_bitmap_page_init() only during recovery.

fsp_fill_free_list(): Initialize the FIL_PAGE_TYPE using MLOG_2BYTES.
The page contents will already have been zeroed out by
MLOG_INIT_FILE_PAGE2.

ibuf_bitmap_init_apply(): Replaces ibuf_parse_bitmap_init().
parent b8e867e8
......@@ -1065,9 +1065,9 @@ fsp_fill_free_list(
buf_block_dbg_add_level(block, SYNC_FSP_PAGE);
fsp_init_file_page(space, block, &ibuf_mtr);
ibuf_bitmap_page_init(block, &ibuf_mtr);
mlog_write_ulint(block->frame + FIL_PAGE_TYPE,
FIL_PAGE_IBUF_BITMAP,
MLOG_2BYTES, &ibuf_mtr);
mtr_commit(&ibuf_mtr);
}
}
......
......@@ -584,13 +584,8 @@ ibuf_max_size_update(
}
/*********************************************************************//**
Initializes an ibuf bitmap page. */
void
ibuf_bitmap_page_init(
/*==================*/
buf_block_t* block, /*!< in: bitmap page */
mtr_t* mtr) /*!< in: mtr */
/** Apply MLOG_IBUF_BITMAP_INIT when crash-upgrading */
ATTRIBUTE_COLD void ibuf_bitmap_init_apply(buf_block_t* block)
{
page_t* page;
ulint byte_offset;
......@@ -605,30 +600,6 @@ ibuf_bitmap_page_init(
* IBUF_BITS_PER_PAGE);
memset(page + IBUF_BITMAP, 0, byte_offset);
/* The remaining area (up to the page trailer) is uninitialized. */
mlog_write_initial_log_record(page, MLOG_IBUF_BITMAP_INIT, mtr);
}
/*********************************************************************//**
Parses a redo log record of an ibuf bitmap page init.
@return end of log record or NULL */
byte*
ibuf_parse_bitmap_init(
/*===================*/
byte* ptr, /*!< in: buffer */
byte* end_ptr MY_ATTRIBUTE((unused)), /*!< in: buffer end */
buf_block_t* block, /*!< in: block or NULL */
mtr_t* mtr) /*!< in: mtr or NULL */
{
ut_ad(ptr != NULL);
ut_ad(end_ptr != NULL);
if (block) {
ibuf_bitmap_page_init(block, mtr);
}
return(ptr);
}
# ifdef UNIV_DEBUG
......
......@@ -119,13 +119,6 @@ ibuf_mtr_commit(
/*============*/
mtr_t* mtr) /*!< in/out: mini-transaction */
MY_ATTRIBUTE((nonnull));
/*********************************************************************//**
Initializes an ibuf bitmap page. */
void
ibuf_bitmap_page_init(
/*==================*/
buf_block_t* block, /*!< in: bitmap page */
mtr_t* mtr); /*!< in: mtr */
/************************************************************************//**
Resets the free bits of the page in the ibuf bitmap. This is done in a
separate mini-transaction, hence this operation does not restrict
......@@ -372,16 +365,8 @@ ibuf_merge_space(
/*=============*/
ulint space); /*!< in: space id */
/*********************************************************************//**
Parses a redo log record of an ibuf bitmap page init.
@return end of log record or NULL */
byte*
ibuf_parse_bitmap_init(
/*===================*/
byte* ptr, /*!< in: buffer */
byte* end_ptr,/*!< in: buffer end */
buf_block_t* block, /*!< in: block or NULL */
mtr_t* mtr); /*!< in: mtr or NULL */
/** Apply MLOG_IBUF_BITMAP_INIT when crash-upgrading */
ATTRIBUTE_COLD void ibuf_bitmap_init_apply(buf_block_t* block);
#ifdef UNIV_IBUF_COUNT_DEBUG
/** Gets the ibuf count for a given page.
......
/*****************************************************************************
Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2017, 2018, MariaDB Corporation.
Copyright (c) 2017, 2019, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
......@@ -118,7 +118,7 @@ enum mlog_id_t {
/** mark an index record as the predefined minimum record */
MLOG_REC_MIN_MARK = 26,
/** initialize an ibuf bitmap page */
/** initialize an ibuf bitmap page (used in MariaDB 10.2 and 10.3) */
MLOG_IBUF_BITMAP_INIT = 27,
#ifdef UNIV_LOG_LSN_DEBUG
......
......@@ -1516,7 +1516,7 @@ recv_parse_or_apply_log_rec_body(
break;
case MLOG_IBUF_BITMAP_INIT:
/* Allow anything in page_type when creating a page. */
ptr = ibuf_parse_bitmap_init(ptr, end_ptr, block, mtr);
if (block) ibuf_bitmap_init_apply(block);
break;
case MLOG_INIT_FILE_PAGE2:
/* Allow anything in page_type when creating a page. */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment