summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2021-09-06 10:14:24 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2021-09-06 10:14:24 +0300
commit84c578c7952161fe5068fea003f0f8b1d62caa89 (patch)
tree8f0ebaf78046513db698370aafdb2666e487a5dc
parent7d351f1aa007244ec7b730500018221f4a6c294b (diff)
downloadmariadb-git-84c578c7952161fe5068fea003f0f8b1d62caa89.tar.gz
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.
-rw-r--r--storage/innobase/btr/btr0cur.cc16
-rw-r--r--storage/innobase/buf/buf0dump.cc4
-rw-r--r--storage/innobase/buf/buf0rea.cc7
-rw-r--r--storage/innobase/include/buf0rea.h7
4 files changed, 16 insertions, 18 deletions
diff --git a/storage/innobase/btr/btr0cur.cc b/storage/innobase/btr/btr0cur.cc
index a3351800231..cfff322f547 100644
--- a/storage/innobase/btr/btr0cur.cc
+++ b/storage/innobase/btr/btr0cur.cc
@@ -3341,16 +3341,16 @@ static void btr_cur_prefetch_siblings(const buf_block_t *block,
uint32_t prev= mach_read_from_4(my_assume_aligned<4>(page + FIL_PAGE_PREV));
uint32_t next= mach_read_from_4(my_assume_aligned<4>(page + FIL_PAGE_NEXT));
+ fil_space_t *space= index->table->space;
+
if (prev == FIL_NULL);
- else if (index->table->space->acquire())
- buf_read_page_background(index->table->space,
- page_id_t(block->page.id().space(), prev),
- block->zip_size(), false);
+ else if (space->acquire())
+ buf_read_page_background(space, page_id_t(space->id, prev),
+ block->zip_size());
if (next == FIL_NULL);
- else if (index->table->space->acquire())
- buf_read_page_background(index->table->space,
- page_id_t(block->page.id().space(), next),
- block->zip_size(), false);
+ else if (space->acquire())
+ buf_read_page_background(space, page_id_t(space->id, next),
+ block->zip_size());
}
/*************************************************************//**
diff --git a/storage/innobase/buf/buf0dump.cc b/storage/innobase/buf/buf0dump.cc
index c6ddcb4fa48..2e6365eb39f 100644
--- a/storage/innobase/buf/buf0dump.cc
+++ b/storage/innobase/buf/buf0dump.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 2011, 2017, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2017, 2020, MariaDB Corporation.
+Copyright (c) 2017, 2021, 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
@@ -678,7 +678,7 @@ buf_load()
}
space->reacquire();
- buf_read_page_background(space, dump[i], zip_size, true);
+ buf_read_page_background(space, dump[i], zip_size);
if (buf_load_abort_flag) {
if (space) {
diff --git a/storage/innobase/buf/buf0rea.cc b/storage/innobase/buf/buf0rea.cc
index 42b3f674f81..2303ef625e7 100644
--- a/storage/innobase/buf/buf0rea.cc
+++ b/storage/innobase/buf/buf0rea.cc
@@ -501,14 +501,13 @@ an exclusive lock on the buffer frame. The flag is cleared and the x-lock
released by the i/o-handler thread.
@param[in,out] space tablespace
@param[in] page_id page id
-@param[in] zip_size ROW_FORMAT=COMPRESSED page size, or 0
-@param[in] sync true if synchronous aio is desired */
+@param[in] zip_size ROW_FORMAT=COMPRESSED page size, or 0 */
void buf_read_page_background(fil_space_t *space, const page_id_t page_id,
- ulint zip_size, bool sync)
+ ulint zip_size)
{
dberr_t err;
- if (buf_read_page_low(&err, space, sync, BUF_READ_ANY_PAGE,
+ if (buf_read_page_low(&err, space, false, BUF_READ_ANY_PAGE,
page_id, zip_size, false)) {
srv_stats.buf_pool_reads.add(1);
}
diff --git a/storage/innobase/include/buf0rea.h b/storage/innobase/include/buf0rea.h
index 87c6b5d7e75..8d6b28194dc 100644
--- a/storage/innobase/include/buf0rea.h
+++ b/storage/innobase/include/buf0rea.h
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2015, 2020, MariaDB Corporation.
+Copyright (c) 2015, 2021, 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
@@ -48,10 +48,9 @@ an exclusive lock on the buffer frame. The flag is cleared and the x-lock
released by the i/o-handler thread.
@param[in,out] space tablespace
@param[in] page_id page id
-@param[in] zip_size ROW_FORMAT=COMPRESSED page size, or 0
-@param[in] sync true if synchronous aio is desired */
+@param[in] zip_size ROW_FORMAT=COMPRESSED page size, or 0 */
void buf_read_page_background(fil_space_t *space, const page_id_t page_id,
- ulint zip_size, bool sync)
+ ulint zip_size)
MY_ATTRIBUTE((nonnull));
/** Applies a random read-ahead in buf_pool if there are at least a threshold