mirror of
https://github.com/MariaDB/server.git
synced 2025-01-19 21:42:35 +01:00
branches/zip: Stamp (space_id, page_no) on buffer pool pages early on.
buf_flush_init_for_writing(): Remove parameters space, page_no. fsp_init_file_page_low(): Wriet space_id and page_no to the page. fil_create_new_single_table_tablespace(): Write space_id to the page.
This commit is contained in:
parent
d699fde33a
commit
606bd38428
5 changed files with 21 additions and 36 deletions
|
@ -503,9 +503,7 @@ buf_flush_init_for_writing(
|
|||
/*=======================*/
|
||||
byte* page, /* in/out: page */
|
||||
void* page_zip_, /* in/out: compressed page, or NULL */
|
||||
dulint newest_lsn, /* in: newest modification lsn to the page */
|
||||
ulint space, /* in: space id */
|
||||
ulint page_no) /* in: page number */
|
||||
dulint newest_lsn) /* in: newest modification lsn to the page */
|
||||
{
|
||||
if (page_zip_) {
|
||||
page_zip_des_t* page_zip = page_zip_;
|
||||
|
@ -525,18 +523,8 @@ buf_flush_init_for_writing(
|
|||
/* fall through */
|
||||
case FIL_PAGE_TYPE_ZBLOB:
|
||||
case FIL_PAGE_INDEX:
|
||||
mach_write_to_4(page
|
||||
+ FIL_PAGE_OFFSET, page_no);
|
||||
mach_write_to_4(page
|
||||
+ FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID,
|
||||
space);
|
||||
mach_write_to_4(page_zip->data
|
||||
+ FIL_PAGE_OFFSET, page_no);
|
||||
mach_write_to_8(page_zip->data
|
||||
+ FIL_PAGE_LSN, newest_lsn);
|
||||
mach_write_to_4(page_zip->data
|
||||
+ FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID,
|
||||
space);
|
||||
memset(page_zip->data + FIL_PAGE_FILE_FLUSH_LSN, 0, 8);
|
||||
mach_write_to_4(page_zip->data
|
||||
+ FIL_PAGE_SPACE_OR_CHKSUM,
|
||||
|
@ -555,10 +543,6 @@ buf_flush_init_for_writing(
|
|||
|
||||
mach_write_to_8(page + UNIV_PAGE_SIZE - FIL_PAGE_END_LSN_OLD_CHKSUM,
|
||||
newest_lsn);
|
||||
/* Write the page number and the space id */
|
||||
|
||||
mach_write_to_4(page + FIL_PAGE_OFFSET, page_no);
|
||||
mach_write_to_4(page + FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID, space);
|
||||
|
||||
/* Store the new formula checksum */
|
||||
|
||||
|
@ -612,8 +596,7 @@ buf_flush_write_block_low(
|
|||
#endif
|
||||
buf_flush_init_for_writing(block->frame,
|
||||
buf_frame_get_page_zip(block->frame),
|
||||
block->newest_modification,
|
||||
block->space, block->offset);
|
||||
block->newest_modification);
|
||||
if (!srv_use_doublewrite_buf || !trx_doublewrite) {
|
||||
fil_io(OS_FILE_WRITE | OS_AIO_SIMULATED_WAKE_LATER,
|
||||
FALSE, block->space, block->page_zip.size,
|
||||
|
|
|
@ -2651,18 +2651,17 @@ error_exit2:
|
|||
memset(page, '\0', UNIV_PAGE_SIZE);
|
||||
|
||||
fsp_header_init_fields(page, *space_id, zip_size);
|
||||
mach_write_to_4(page + FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID, *space_id);
|
||||
|
||||
if (!zip_size) {
|
||||
buf_flush_init_for_writing(page, NULL,
|
||||
ut_dulint_zero, *space_id, 0);
|
||||
buf_flush_init_for_writing(page, NULL, ut_dulint_zero);
|
||||
ret = os_file_write(path, file, page, 0, 0, UNIV_PAGE_SIZE);
|
||||
} else {
|
||||
page_zip_des_t page_zip;
|
||||
page_zip.size = zip_size;
|
||||
page_zip.data = page + UNIV_PAGE_SIZE;
|
||||
page_zip.n_blobs = page_zip.m_start = page_zip.m_end = 0;
|
||||
buf_flush_init_for_writing(page, &page_zip,
|
||||
ut_dulint_zero, *space_id, 0);
|
||||
buf_flush_init_for_writing(page, &page_zip, ut_dulint_zero);
|
||||
ret = os_file_write(path, file, page_zip.data, 0, 0, zip_size);
|
||||
}
|
||||
|
||||
|
@ -2746,7 +2745,6 @@ fil_reset_too_high_lsns(
|
|||
ulint space_id;
|
||||
ib_longlong file_size;
|
||||
ib_longlong offset;
|
||||
ulint page_no;
|
||||
ulint zip_size;
|
||||
ibool success;
|
||||
|
||||
|
@ -2832,19 +2830,15 @@ fil_reset_too_high_lsns(
|
|||
if (ut_dulint_cmp(mach_read_from_8(page + FIL_PAGE_LSN),
|
||||
current_lsn) > 0) {
|
||||
/* We have to reset the lsn */
|
||||
space_id = mach_read_from_4(
|
||||
page + FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID);
|
||||
page_no = mach_read_from_4(page + FIL_PAGE_OFFSET);
|
||||
|
||||
if (zip_size) {
|
||||
memcpy(page + UNIV_PAGE_SIZE, page, zip_size);
|
||||
buf_flush_init_for_writing(
|
||||
page, page + UNIV_PAGE_SIZE,
|
||||
current_lsn, space_id, page_no);
|
||||
current_lsn);
|
||||
} else {
|
||||
buf_flush_init_for_writing(
|
||||
page, NULL,
|
||||
current_lsn, space_id, page_no);
|
||||
page, NULL, current_lsn);
|
||||
}
|
||||
success = os_file_write(filepath, file, page,
|
||||
(ulint)(offset & 0xFFFFFFFFUL),
|
||||
|
|
|
@ -826,14 +826,25 @@ fsp_init_file_page_low(
|
|||
if (UNIV_LIKELY_NULL(page_zip)) {
|
||||
memset(page, 0, UNIV_PAGE_SIZE);
|
||||
memset(page_zip->data, 0, page_zip->size);
|
||||
mach_write_to_4(page + FIL_PAGE_OFFSET, block->offset);
|
||||
mach_write_to_4(page
|
||||
+ FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID,
|
||||
block->space);
|
||||
mach_write_to_4(page_zip->data
|
||||
+ FIL_PAGE_OFFSET, block->offset);
|
||||
mach_write_to_4(page_zip->data
|
||||
+ FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID,
|
||||
block->space);
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef UNIV_BASIC_LOG_DEBUG
|
||||
memset(page, 0xff, UNIV_PAGE_SIZE);
|
||||
#endif
|
||||
memset(page + UNIV_PAGE_SIZE - FIL_PAGE_END_LSN_OLD_CHKSUM, 0, 8);
|
||||
mach_write_to_4(page + FIL_PAGE_OFFSET, block->offset);
|
||||
memset(page + FIL_PAGE_LSN, 0, 8);
|
||||
mach_write_to_4(page + FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID, block->space);
|
||||
memset(page + UNIV_PAGE_SIZE - FIL_PAGE_END_LSN_OLD_CHKSUM, 0, 8);
|
||||
}
|
||||
|
||||
/***************************************************************
|
||||
|
|
|
@ -36,9 +36,7 @@ buf_flush_init_for_writing(
|
|||
/*=======================*/
|
||||
byte* page, /* in/out: page */
|
||||
void* page_zip, /* in/out: compressed page, or NULL */
|
||||
dulint newest_lsn, /* in: newest modification lsn to the page */
|
||||
ulint space, /* in: space id */
|
||||
ulint page_no); /* in: page number */
|
||||
dulint newest_lsn); /* in: newest modification lsn to the page */
|
||||
/***********************************************************************
|
||||
This utility flushes dirty blocks from the end of the LRU list or flush_list.
|
||||
NOTE 1: in the case of an LRU flush the calling thread may own latches to
|
||||
|
|
|
@ -1656,8 +1656,7 @@ recv_apply_log_recs_for_backup(void)
|
|||
|
||||
buf_flush_init_for_writing(
|
||||
block->frame, buf_block_get_page_zip(block),
|
||||
mach_read_from_8(block->frame + FIL_PAGE_LSN),
|
||||
recv_addr->space, recv_addr->page_no);
|
||||
mach_read_from_8(block->frame + FIL_PAGE_LSN));
|
||||
|
||||
if (zip_size) {
|
||||
error = fil_io(OS_FILE_WRITE, TRUE,
|
||||
|
|
Loading…
Reference in a new issue