summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Lindström <jan.lindstrom@mariadb.com>2017-05-11 11:15:37 +0300
committerJan Lindström <jan.lindstrom@mariadb.com>2017-05-11 11:15:37 +0300
commit8edbb1117a9e1fd81fbd08b8f1d06c72efe38f44 (patch)
tree54ccfa1af2dea54316f43dada03736a11c2166aa
parentf4df8c00c957146f04db031f1f9f80aab229d1d2 (diff)
downloadmariadb-git-bb-10.2-MDEV-12741.tar.gz
MDEV-12741: innodb.ibuf_not_empty failed in buildbot with "InnoDB: Trying to do I/O to a tablespace which does not exist"bb-10.2-MDEV-12741
Background thread is doing ibuf merge, in buf0rea.cc buf_read_ibuf_merge_pages(). It first tries to get page_size and if space is not found it deletes them, but as we do not hold any mutexes, space can be marked as stopped between that and buf_read_page_low() for same space. This naturally leads seen error message on log. buf_read_page_low(): Add parameter ignore_missing_space = false that is passed to fil_io() buf_read_ibuf_merge_pages(): call buf_read_page_low with ignore_missing_space = true, this function will handle missing space error code after buf_read_page_low returns. fil_io(): if ignore_missing_space = true do not print error message about trying to do I/0 for missing space, just return correct error code that is handled later.
-rw-r--r--storage/innobase/buf/buf0rea.cc8
-rw-r--r--storage/innobase/fil/fil0fil.cc6
-rw-r--r--storage/innobase/include/fil0fil.h6
3 files changed, 13 insertions, 7 deletions
diff --git a/storage/innobase/buf/buf0rea.cc b/storage/innobase/buf/buf0rea.cc
index 12775c74daf..062673287fa 100644
--- a/storage/innobase/buf/buf0rea.cc
+++ b/storage/innobase/buf/buf0rea.cc
@@ -105,6 +105,7 @@ flag is cleared and the x-lock released by an i/o-handler thread.
@param[in] mode BUF_READ_IBUF_PAGES_ONLY, ...,
@param[in] page_id page id
@param[in] unzip true=request uncompressed page
+@param[in] ignore_missing_space true=ignore missing space when reading
@return 1 if a read request was queued, 0 if the page already resided
in buf_pool, or if the page is in the doublewrite buffer blocks in
which case it is never read into the pool, or if the tablespace does
@@ -118,7 +119,8 @@ buf_read_page_low(
ulint mode,
const page_id_t& page_id,
const page_size_t& page_size,
- bool unzip)
+ bool unzip,
+ bool ignore_missing_space = false)
{
buf_page_t* bpage;
@@ -178,7 +180,7 @@ buf_read_page_low(
*err = fil_io(
request, sync, page_id, page_size, 0, page_size.physical(),
- dst, bpage);
+ dst, bpage, ignore_missing_space);
if (sync) {
thd_wait_end(NULL);
@@ -846,7 +848,7 @@ tablespace_deleted:
sync && (i + 1 == n_stored),
0,
BUF_READ_ANY_PAGE, page_id, page_size,
- true);
+ true, true /* ignore_missing_space */);
switch(err) {
case DB_SUCCESS:
diff --git a/storage/innobase/fil/fil0fil.cc b/storage/innobase/fil/fil0fil.cc
index ce417b1e511..3b80b662dbc 100644
--- a/storage/innobase/fil/fil0fil.cc
+++ b/storage/innobase/fil/fil0fil.cc
@@ -5186,6 +5186,7 @@ fil_report_invalid_page_access(
aligned
@param[in] message message for aio handler if non-sync aio
used, else ignored
+@param[in] ignore_missing_space true=ignore missing space duging read
@return DB_SUCCESS, DB_TABLESPACE_DELETED or DB_TABLESPACE_TRUNCATED
if we are trying to do i/o on a tablespace which does not exist */
dberr_t
@@ -5197,7 +5198,8 @@ fil_io(
ulint byte_offset,
ulint len,
void* buf,
- void* message)
+ void* message,
+ bool ignore_missing_space)
{
os_offset_t offset;
IORequest req_type(type);
@@ -5276,7 +5278,7 @@ fil_io(
mutex_exit(&fil_system->mutex);
- if (!req_type.ignore_missing()) {
+ if (!req_type.ignore_missing() && !ignore_missing_space) {
ib::error()
<< "Trying to do I/O to a tablespace which"
" does not exist. I/O type: "
diff --git a/storage/innobase/include/fil0fil.h b/storage/innobase/include/fil0fil.h
index d8b6cf33675..4bb4b29e3dd 100644
--- a/storage/innobase/include/fil0fil.h
+++ b/storage/innobase/include/fil0fil.h
@@ -1225,7 +1225,7 @@ fil_space_get_n_reserved_extents(
aligned
@param[in] message message for aio handler if non-sync aio
used, else ignored
-
+@param[in] ignore_missing_space true=ignore missing space during read
@return DB_SUCCESS, DB_TABLESPACE_DELETED or DB_TABLESPACE_TRUNCATED
if we are trying to do i/o on a tablespace which does not exist */
dberr_t
@@ -1237,7 +1237,9 @@ fil_io(
ulint byte_offset,
ulint len,
void* buf,
- void* message);
+ void* message,
+ bool ignore_missing_space = false);
+
/**********************************************************************//**
Waits for an aio operation to complete. This function is used to write the
handler for completed requests. The aio array of pending requests is divided