summaryrefslogtreecommitdiff
path: root/storage/innobase/buf
diff options
context:
space:
mode:
Diffstat (limited to 'storage/innobase/buf')
-rw-r--r--storage/innobase/buf/buf0dblwr.cc3
-rw-r--r--storage/innobase/buf/buf0lru.cc26
-rw-r--r--storage/innobase/buf/buf0rea.cc26
3 files changed, 21 insertions, 34 deletions
diff --git a/storage/innobase/buf/buf0dblwr.cc b/storage/innobase/buf/buf0dblwr.cc
index 8c473b0c658..043a5ffd426 100644
--- a/storage/innobase/buf/buf0dblwr.cc
+++ b/storage/innobase/buf/buf0dblwr.cc
@@ -560,7 +560,8 @@ buf_dblwr_process()
is scheduled for truncation or was truncated
and we have parsed an MLOG_TRUNCATE record. */
if (!srv_is_tablespace_truncated(space_id)
- && !srv_was_tablespace_truncated(space)) {
+ && !srv_was_tablespace_truncated(space)
+ && !srv_is_undo_tablespace(space_id)) {
ib::warn() << "A copy of page " << page_id
<< " in the doublewrite buffer slot "
<< page_no_dblwr
diff --git a/storage/innobase/buf/buf0lru.cc b/storage/innobase/buf/buf0lru.cc
index 125c5beb47c..f9b2189c79a 100644
--- a/storage/innobase/buf/buf0lru.cc
+++ b/storage/innobase/buf/buf0lru.cc
@@ -557,13 +557,15 @@ the list as they age towards the tail of the LRU.
@param[in] id tablespace identifier
@param[in] observer flush observer (to check for interrupt),
or NULL if the files should not be written to
-@return whether all dirty pages were freed */
+@param[in] first first page to be flushed or evicted
+@return whether all matching dirty pages were removed */
static MY_ATTRIBUTE((warn_unused_result))
bool
buf_flush_or_remove_pages(
buf_pool_t* buf_pool,
ulint id,
- FlushObserver* observer)
+ FlushObserver* observer,
+ ulint first)
{
buf_page_t* prev;
buf_page_t* bpage;
@@ -604,6 +606,8 @@ rescan:
} else if (id != bpage->id.space()) {
/* Skip this block, because it is for a
different tablespace. */
+ } else if (bpage->id.page_no() < first) {
+ /* Skip this block, because it is below the limit. */
} else if (!buf_flush_or_remove_page(
buf_pool, bpage, observer != NULL)) {
@@ -667,18 +671,20 @@ the tail of the LRU list.
@param[in] id tablespace identifier
@param[in] observer flush observer,
or NULL if the files should not be written to
-*/
+@param[in] first first page to be flushed or evicted */
static
void
buf_flush_dirty_pages(
buf_pool_t* buf_pool,
ulint id,
- FlushObserver* observer)
+ FlushObserver* observer,
+ ulint first)
{
for (;;) {
buf_pool_mutex_enter(buf_pool);
- bool freed = buf_flush_or_remove_pages(buf_pool, id, observer);
+ bool freed = buf_flush_or_remove_pages(buf_pool, id, observer,
+ first);
buf_pool_mutex_exit(buf_pool);
@@ -693,20 +699,24 @@ buf_flush_dirty_pages(
}
ut_ad((observer && observer->is_interrupted())
+ || first
|| buf_pool_get_dirty_pages_count(buf_pool, id, observer) == 0);
}
/** Empty the flush list for all pages belonging to a tablespace.
@param[in] id tablespace identifier
@param[in] observer flush observer,
- or NULL if nothing is to be written */
-void buf_LRU_flush_or_remove_pages(ulint id, FlushObserver* observer)
+ or NULL if nothing is to be written
+@param[in] first first page to be flushed or evicted */
+void buf_LRU_flush_or_remove_pages(ulint id, FlushObserver* observer,
+ ulint first)
{
/* Pages in the system tablespace must never be discarded. */
ut_ad(id || observer);
for (ulint i = 0; i < srv_buf_pool_instances; i++) {
- buf_flush_dirty_pages(buf_pool_from_array(i), id, observer);
+ buf_flush_dirty_pages(buf_pool_from_array(i), id, observer,
+ first);
}
if (observer && !observer->is_interrupted()) {
diff --git a/storage/innobase/buf/buf0rea.cc b/storage/innobase/buf/buf0rea.cc
index 00b2ac378db..14d1d3d4706 100644
--- a/storage/innobase/buf/buf0rea.cc
+++ b/storage/innobase/buf/buf0rea.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1995, 2017, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2015, 2017, MariaDB Corporation.
+Copyright (c) 2015, 2018, 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
@@ -176,17 +176,6 @@ buf_read_page_low(
dst = ((buf_block_t*) bpage)->frame;
}
- DBUG_EXECUTE_IF(
- "innodb_invalid_read_after_truncate",
- if (fil_space_t* space = fil_space_acquire(page_id.space())) {
- if (!strcmp(space->name, "test/t1")
- && page_id.page_no() == space->size - 1) {
- type = 0;
- sync = true;
- }
- space->release();
- });
-
IORequest request(type | IORequest::READ);
*err = fil_io(
@@ -332,19 +321,6 @@ buf_read_ahead_random(
that is, reside near the start of the LRU list. */
for (i = low; i < high; i++) {
- DBUG_EXECUTE_IF(
- "innodb_invalid_read_after_truncate",
- if (fil_space_t* space = fil_space_acquire(
- page_id.space())) {
- bool skip = !strcmp(space->name, "test/t1");
- space->release();
- if (skip) {
- high = space->size;
- buf_pool_mutex_exit(buf_pool);
- goto read_ahead;
- }
- });
-
const buf_page_t* bpage = buf_page_hash_get(
buf_pool, page_id_t(page_id.space(), i));