Skip to content

Commit 84c578c

Browse files
committed
MDEV-26547 Restoring InnoDB buffer pool dump is single-threaded for no reason
buf_read_page_background(): Remove the parameter "bool sync" and always actually initiate a page read in the background. buf_load(): Always submit asynchronous reads. This allows page checksums to be verified in concurrent threads as soon as the reads are completed.
1 parent 7d351f1 commit 84c578c

File tree

4 files changed

+16
-18
lines changed

4 files changed

+16
-18
lines changed

storage/innobase/btr/btr0cur.cc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3341,16 +3341,16 @@ static void btr_cur_prefetch_siblings(const buf_block_t *block,
33413341
uint32_t prev= mach_read_from_4(my_assume_aligned<4>(page + FIL_PAGE_PREV));
33423342
uint32_t next= mach_read_from_4(my_assume_aligned<4>(page + FIL_PAGE_NEXT));
33433343

3344+
fil_space_t *space= index->table->space;
3345+
33443346
if (prev == FIL_NULL);
3345-
else if (index->table->space->acquire())
3346-
buf_read_page_background(index->table->space,
3347-
page_id_t(block->page.id().space(), prev),
3348-
block->zip_size(), false);
3347+
else if (space->acquire())
3348+
buf_read_page_background(space, page_id_t(space->id, prev),
3349+
block->zip_size());
33493350
if (next == FIL_NULL);
3350-
else if (index->table->space->acquire())
3351-
buf_read_page_background(index->table->space,
3352-
page_id_t(block->page.id().space(), next),
3353-
block->zip_size(), false);
3351+
else if (space->acquire())
3352+
buf_read_page_background(space, page_id_t(space->id, next),
3353+
block->zip_size());
33543354
}
33553355

33563356
/*************************************************************//**

storage/innobase/buf/buf0dump.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*****************************************************************************
22
33
Copyright (c) 2011, 2017, Oracle and/or its affiliates. All Rights Reserved.
4-
Copyright (c) 2017, 2020, MariaDB Corporation.
4+
Copyright (c) 2017, 2021, MariaDB Corporation.
55
66
This program is free software; you can redistribute it and/or modify it under
77
the terms of the GNU General Public License as published by the Free Software
@@ -678,7 +678,7 @@ buf_load()
678678
}
679679

680680
space->reacquire();
681-
buf_read_page_background(space, dump[i], zip_size, true);
681+
buf_read_page_background(space, dump[i], zip_size);
682682

683683
if (buf_load_abort_flag) {
684684
if (space) {

storage/innobase/buf/buf0rea.cc

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -501,14 +501,13 @@ an exclusive lock on the buffer frame. The flag is cleared and the x-lock
501501
released by the i/o-handler thread.
502502
@param[in,out] space tablespace
503503
@param[in] page_id page id
504-
@param[in] zip_size ROW_FORMAT=COMPRESSED page size, or 0
505-
@param[in] sync true if synchronous aio is desired */
504+
@param[in] zip_size ROW_FORMAT=COMPRESSED page size, or 0 */
506505
void buf_read_page_background(fil_space_t *space, const page_id_t page_id,
507-
ulint zip_size, bool sync)
506+
ulint zip_size)
508507
{
509508
dberr_t err;
510509

511-
if (buf_read_page_low(&err, space, sync, BUF_READ_ANY_PAGE,
510+
if (buf_read_page_low(&err, space, false, BUF_READ_ANY_PAGE,
512511
page_id, zip_size, false)) {
513512
srv_stats.buf_pool_reads.add(1);
514513
}

storage/innobase/include/buf0rea.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*****************************************************************************
22
33
Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved.
4-
Copyright (c) 2015, 2020, MariaDB Corporation.
4+
Copyright (c) 2015, 2021, MariaDB Corporation.
55
66
This program is free software; you can redistribute it and/or modify it under
77
the terms of the GNU General Public License as published by the Free Software
@@ -48,10 +48,9 @@ an exclusive lock on the buffer frame. The flag is cleared and the x-lock
4848
released by the i/o-handler thread.
4949
@param[in,out] space tablespace
5050
@param[in] page_id page id
51-
@param[in] zip_size ROW_FORMAT=COMPRESSED page size, or 0
52-
@param[in] sync true if synchronous aio is desired */
51+
@param[in] zip_size ROW_FORMAT=COMPRESSED page size, or 0 */
5352
void buf_read_page_background(fil_space_t *space, const page_id_t page_id,
54-
ulint zip_size, bool sync)
53+
ulint zip_size)
5554
MY_ATTRIBUTE((nonnull));
5655

5756
/** Applies a random read-ahead in buf_pool if there are at least a threshold

0 commit comments

Comments
 (0)