summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2022-11-30 12:09:01 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2022-11-30 12:09:01 +0200
commitb7ae4d442aa32752798f1d3b6122c35c4ebe2d07 (patch)
tree8389a43f1db8c01fbc016e07208b111bee428177 /storage
parentf124d71ab75e0d449eb80fb909fa3b0ac4b191a8 (diff)
parent4783f37cf79150db55a7258683e50a04d987af1d (diff)
downloadmariadb-git-b7ae4d442aa32752798f1d3b6122c35c4ebe2d07.tar.gz
Merge 10.6 into 10.7
Diffstat (limited to 'storage')
-rw-r--r--storage/innobase/buf/buf0dblwr.cc8
-rw-r--r--storage/innobase/fil/fil0fil.cc5
-rw-r--r--storage/innobase/fsp/fsp0file.cc7
-rw-r--r--storage/innobase/handler/i_s.cc9
-rw-r--r--storage/innobase/include/fil0fil.h9
-rw-r--r--storage/innobase/include/os0file.h65
-rw-r--r--storage/innobase/include/os0file.inl46
-rw-r--r--storage/innobase/log/log0log.cc3
-rw-r--r--storage/innobase/log/log0recv.cc2
-rw-r--r--storage/innobase/os/os0file.cc122
-rw-r--r--storage/innobase/row/row0import.cc37
-rw-r--r--storage/innobase/row/row0log.cc12
-rw-r--r--storage/innobase/row/row0merge.cc14
-rw-r--r--storage/innobase/srv/srv0start.cc3
14 files changed, 92 insertions, 250 deletions
diff --git a/storage/innobase/buf/buf0dblwr.cc b/storage/innobase/buf/buf0dblwr.cc
index 3c59955dbd8..88e5823e78b 100644
--- a/storage/innobase/buf/buf0dblwr.cc
+++ b/storage/innobase/buf/buf0dblwr.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1995, 2017, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2013, 2021, MariaDB Corporation.
+Copyright (c) 2013, 2022, 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
@@ -253,7 +253,7 @@ dberr_t buf_dblwr_t::init_or_load_pages(pfs_os_file_t file, const char *path)
/* Read the TRX_SYS header to check if we are using the doublewrite buffer */
dberr_t err= os_file_read(IORequestRead, file, read_buf,
TRX_SYS_PAGE_NO << srv_page_size_shift,
- srv_page_size);
+ srv_page_size, nullptr);
if (err != DB_SUCCESS)
{
@@ -285,7 +285,7 @@ func_exit:
/* Read the pages from the doublewrite buffer to memory */
err= os_file_read(IORequestRead, file, write_buf,
block1.page_no() << srv_page_size_shift,
- size << srv_page_size_shift);
+ size << srv_page_size_shift, nullptr);
if (err != DB_SUCCESS)
{
@@ -296,7 +296,7 @@ func_exit:
err= os_file_read(IORequestRead, file,
write_buf + (size << srv_page_size_shift),
block2.page_no() << srv_page_size_shift,
- size << srv_page_size_shift);
+ size << srv_page_size_shift, nullptr);
if (err != DB_SUCCESS)
{
ib::error() << "Failed to read the second double write buffer extent";
diff --git a/storage/innobase/fil/fil0fil.cc b/storage/innobase/fil/fil0fil.cc
index f78c08e268b..66b21f6ecbd 100644
--- a/storage/innobase/fil/fil0fil.cc
+++ b/storage/innobase/fil/fil0fil.cc
@@ -661,6 +661,7 @@ ATTRIBUTE_COLD bool fil_space_t::prepare_acquired()
if (!is_open)
release();
+ else if (node->deferred);
else if (auto desired_size= recv_size)
{
bool success;
@@ -2734,10 +2735,6 @@ io_error:
buf, offset, len);
}
- /* We an try to recover the page from the double write buffer if
- the decompression fails or the page is corrupt. */
-
- ut_a(type.type == IORequest::DBLWR_RECOVER || err == DB_SUCCESS);
if (!type.is_async()) {
if (type.is_write()) {
release_sync_write:
diff --git a/storage/innobase/fsp/fsp0file.cc b/storage/innobase/fsp/fsp0file.cc
index e85674401ee..9e6b6abcf03 100644
--- a/storage/innobase/fsp/fsp0file.cc
+++ b/storage/innobase/fsp/fsp0file.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 2013, 2016, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2017, 2021, MariaDB Corporation.
+Copyright (c) 2017, 2022, 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
@@ -263,12 +263,11 @@ Datafile::read_first_page(bool read_only_mode)
ulint n_read = 0;
- err = os_file_read_no_error_handling(
+ err = os_file_read(
IORequestReadPartial, m_handle, m_first_page, 0,
page_size, &n_read);
if (err == DB_SUCCESS) {
- ut_a(n_read == page_size);
break;
}
@@ -663,7 +662,7 @@ Datafile::find_space_id()
for (ulint j = 0; j < page_count; ++j) {
if (os_file_read(IORequestRead, m_handle, page,
- j * page_size, page_size)) {
+ j * page_size, page_size, nullptr)) {
ib::info()
<< "READ FAIL: page_no:" << j;
continue;
diff --git a/storage/innobase/handler/i_s.cc b/storage/innobase/handler/i_s.cc
index bb2f1b6beda..0379443e81d 100644
--- a/storage/innobase/handler/i_s.cc
+++ b/storage/innobase/handler/i_s.cc
@@ -6632,7 +6632,6 @@ i_s_dict_fill_tablespaces_encryption(
{
Field** fields;
struct fil_space_crypt_status_t status;
-
DBUG_ENTER("i_s_dict_fill_tablespaces_encryption");
fields = table_to_fill->field;
@@ -6654,6 +6653,14 @@ i_s_dict_fill_tablespaces_encryption(
name.data(), name.size(),
system_charset_info));
fields[TABLESPACES_ENCRYPTION_NAME]->set_notnull();
+ } else if (srv_is_undo_tablespace(space->id)) {
+ char undo_name[sizeof "innodb_undo000"];
+ snprintf(undo_name, sizeof undo_name,
+ "innodb_undo%03" PRIu32, space->id);
+ OK(fields[TABLESPACES_ENCRYPTION_NAME]->store(
+ undo_name, strlen(undo_name),
+ system_charset_info));
+ fields[TABLESPACES_ENCRYPTION_NAME]->set_notnull();
} else {
fields[TABLESPACES_ENCRYPTION_NAME]->set_null();
}
diff --git a/storage/innobase/include/fil0fil.h b/storage/innobase/include/fil0fil.h
index 3aeea21acf4..65198f78988 100644
--- a/storage/innobase/include/fil0fil.h
+++ b/storage/innobase/include/fil0fil.h
@@ -510,10 +510,6 @@ public:
/** @return whether the storage device is rotational (HDD, not SSD) */
inline bool is_rotational() const;
- /** whether the tablespace discovery is being deferred during crash
- recovery due to incompletely written page 0 */
- inline bool is_deferred() const;
-
/** Open each file. Never invoked on .ibd files.
@param create_new_db whether to skip the call to fil_node_t::read_page0()
@return whether all files were opened */
@@ -1141,11 +1137,6 @@ inline bool fil_space_t::is_rotational() const
return false;
}
-inline bool fil_space_t::is_deferred() const
-{
- return UT_LIST_GET_FIRST(chain)->deferred;
-}
-
/** Common InnoDB file extensions */
enum ib_extention {
NO_EXT = 0,
diff --git a/storage/innobase/include/os0file.h b/storage/innobase/include/os0file.h
index 40ffc4297ec..d64ad9feb87 100644
--- a/storage/innobase/include/os0file.h
+++ b/storage/innobase/include/os0file.h
@@ -582,12 +582,8 @@ The wrapper functions have the prefix of "innodb_". */
# define os_file_close(file) \
pfs_os_file_close_func(file, __FILE__, __LINE__)
-# define os_file_read(type, file, buf, offset, n) \
- pfs_os_file_read_func(type, file, buf, offset, n, __FILE__, __LINE__)
-
-# define os_file_read_no_error_handling(type, file, buf, offset, n, o) \
- pfs_os_file_read_no_error_handling_func( \
- type, file, buf, offset, n, o, __FILE__, __LINE__)
+# define os_file_read(type, file, buf, offset, n, o) \
+ pfs_os_file_read_func(type, file, buf, offset, n,o, __FILE__, __LINE__)
# define os_file_write(type, name, file, buf, offset, n) \
pfs_os_file_write_func(type, name, file, buf, offset, \
@@ -732,31 +728,6 @@ pfs_os_file_read_func(
void* buf,
os_offset_t offset,
ulint n,
- const char* src_file,
- uint src_line);
-
-/** NOTE! Please use the corresponding macro os_file_read_no_error_handling(),
-not directly this function!
-This is the performance schema instrumented wrapper function for
-os_file_read_no_error_handling_func() which requests a synchronous
-read operation.
-@param[in] type IO request context
-@param[in] file Open file handle
-@param[out] buf buffer where to read
-@param[in] offset file offset where to read
-@param[in] n number of bytes to read
-@param[out] o number of bytes actually read
-@param[in] src_file file name where func invoked
-@param[in] src_line line where the func invoked
-@return DB_SUCCESS if request was successful */
-UNIV_INLINE
-dberr_t
-pfs_os_file_read_no_error_handling_func(
- const IORequest& type,
- pfs_os_file_t file,
- void* buf,
- os_offset_t offset,
- ulint n,
ulint* o,
const char* src_file,
uint src_line);
@@ -882,11 +853,8 @@ to original un-instrumented file I/O APIs */
# define os_file_close(file) os_file_close_func(file)
-# define os_file_read(type, file, buf, offset, n) \
- os_file_read_func(type, file, buf, offset, n)
-
-# define os_file_read_no_error_handling(type, file, buf, offset, n, o) \
- os_file_read_no_error_handling_func(type, file, buf, offset, n, o)
+# define os_file_read(type, file, buf, offset, n, o) \
+ os_file_read_func(type, file, buf, offset, n, o)
# define os_file_write(type, name, file, buf, offset, n) \
os_file_write_func(type, name, file, buf, offset, n)
@@ -991,6 +959,7 @@ Requests a synchronous read operation.
@param[out] buf buffer where to read
@param[in] offset file offset where to read
@param[in] n number of bytes to read
+@param[out] o number of bytes actually read
@return DB_SUCCESS if request was successful */
dberr_t
os_file_read_func(
@@ -998,7 +967,8 @@ os_file_read_func(
os_file_t file,
void* buf,
os_offset_t offset,
- ulint n)
+ ulint n,
+ ulint* o)
MY_ATTRIBUTE((warn_unused_result));
/** Rewind file to its start, read at most size - 1 bytes from it to str, and
@@ -1013,27 +983,6 @@ os_file_read_string(
char* str,
ulint size);
-/** NOTE! Use the corresponding macro os_file_read_no_error_handling(),
-not directly this function!
-Requests a synchronous positioned read operation. This function does not do
-any error handling. In case of error it returns FALSE.
-@param[in] type IO request context
-@param[in] file Open file handle
-@param[out] buf buffer where to read
-@param[in] offset file offset where to read
-@param[in] n number of bytes to read
-@param[out] o number of bytes actually read
-@return DB_SUCCESS or error code */
-dberr_t
-os_file_read_no_error_handling_func(
- const IORequest& type,
- os_file_t file,
- void* buf,
- os_offset_t offset,
- ulint n,
- ulint* o)
- MY_ATTRIBUTE((warn_unused_result));
-
/** NOTE! Use the corresponding macro os_file_write(), not directly this
function!
Requests a synchronous write operation.
diff --git a/storage/innobase/include/os0file.inl b/storage/innobase/include/os0file.inl
index e88f94b8ff3..7de3150540d 100644
--- a/storage/innobase/include/os0file.inl
+++ b/storage/innobase/include/os0file.inl
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 2010, 2017, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2013, 2020, MariaDB Corporation.
+Copyright (c) 2013, 2022, 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
@@ -210,6 +210,7 @@ os_file_read() which requests a synchronous read operation.
@param[out] buf buffer where to read
@param[in] offset file offset where to read
@param[in] n number of bytes to read
+@param[out] o number of bytes actually read
@param[in] src_file file name where func invoked
@param[in] src_line line where the func invoked
@return DB_SUCCESS if request was successful */
@@ -221,6 +222,7 @@ pfs_os_file_read_func(
void* buf,
os_offset_t offset,
ulint n,
+ ulint* o,
const char* src_file,
uint src_line)
{
@@ -232,47 +234,7 @@ pfs_os_file_read_func(
dberr_t result;
- result = os_file_read_func(type, file, buf, offset, n);
-
- register_pfs_file_io_end(locker, n);
-
- return(result);
-}
-
-/** NOTE! Please use the corresponding macro os_file_read_no_error_handling(),
-not directly this function!
-This is the performance schema instrumented wrapper function for
-os_file_read_no_error_handling_func() which requests a synchronous
-read operation.
-@param[in] type IO request context
-@param[in] file Open file handle
-@param[out] buf buffer where to read
-@param[in] offset file offset where to read
-@param[in] n number of bytes to read
-@param[out] o number of bytes actually read
-@param[in] src_file file name where func invoked
-@param[in] src_line line where the func invoked
-@return DB_SUCCESS if request was successful */
-UNIV_INLINE
-dberr_t
-pfs_os_file_read_no_error_handling_func(
- const IORequest& type,
- pfs_os_file_t file,
- void* buf,
- os_offset_t offset,
- ulint n,
- ulint* o,
- const char* src_file,
- uint src_line)
-{
- PSI_file_locker_state state;
- struct PSI_file_locker* locker = NULL;
-
- register_pfs_file_io_begin(
- &state, locker, file, n, PSI_FILE_READ, src_file, src_line);
-
- dberr_t result = os_file_read_no_error_handling_func(
- type, file, buf, offset, n, o);
+ result = os_file_read_func(type, file, buf, offset, n, o);
register_pfs_file_io_end(locker, n);
diff --git a/storage/innobase/log/log0log.cc b/storage/innobase/log/log0log.cc
index 6c888f9f58b..70f561280d9 100644
--- a/storage/innobase/log/log0log.cc
+++ b/storage/innobase/log/log0log.cc
@@ -275,7 +275,8 @@ dberr_t file_os_io::close() noexcept
dberr_t file_os_io::read(os_offset_t offset, span<byte> buf) noexcept
{
- return os_file_read(IORequestRead, m_fd, buf.data(), offset, buf.size());
+ return os_file_read(IORequestRead, m_fd, buf.data(), offset, buf.size(),
+ nullptr);
}
dberr_t file_os_io::write(const char *path, os_offset_t offset,
diff --git a/storage/innobase/log/log0recv.cc b/storage/innobase/log/log0recv.cc
index 5df535c1d43..deda40fd924 100644
--- a/storage/innobase/log/log0recv.cc
+++ b/storage/innobase/log/log0recv.cc
@@ -998,6 +998,7 @@ bool recv_sys_t::recover_deferred(recv_sys_t::map::iterator &p,
{
space->size= node->size= n_pages;
space->set_committed_size();
+ goto size_set;
}
}
if (!os_file_set_size(node->name, node->handle,
@@ -1007,6 +1008,7 @@ bool recv_sys_t::recover_deferred(recv_sys_t::map::iterator &p,
space->release();
goto release_and_fail;
}
+ size_set:
node->deferred= false;
space->release();
it->second.space= space;
diff --git a/storage/innobase/os/os0file.cc b/storage/innobase/os/os0file.cc
index b49723b6fc8..5cbf5803577 100644
--- a/storage/innobase/os/os0file.cc
+++ b/storage/innobase/os/os0file.cc
@@ -36,6 +36,7 @@ Created 10/21/1995 Heikki Tuuri
#ifndef UNIV_INNOCHECKSUM
#include "os0file.h"
#include "sql_const.h"
+#include "log.h"
#ifdef __linux__
# include <sys/types.h>
@@ -177,7 +178,7 @@ mysql_pfs_key_t innodb_temp_file_key;
@param[in] should_abort whether to abort on an unknown error
@param[in] on_error_silent whether to suppress reports of non-fatal errors
@return true if we should retry the operation */
-static MY_ATTRIBUTE((warn_unused_result))
+static
bool
os_file_handle_error_cond_exit(
const char* name,
@@ -2768,15 +2769,15 @@ os_file_io(
bytes_returned += n_bytes;
if (type.type != IORequest::READ_MAYBE_PARTIAL) {
- const char* op = type.is_read()
- ? "read" : "written";
-
- ib::warn()
- << n
- << " bytes should have been " << op << ". Only "
- << bytes_returned
- << " bytes " << op << ". Retrying"
- << " for the remaining bytes.";
+ sql_print_warning("InnoDB: %zu bytes should have been"
+ " %s at %llu from %s,"
+ " but got only %zd."
+ " Retrying.",
+ n, type.is_read()
+ ? "read" : "written", offset,
+ type.node
+ ? type.node->name
+ : "(unknown file)", bytes_returned);
}
/* Advance the offset and buffer by n_bytes */
@@ -2917,52 +2918,38 @@ os_file_pread(
@param[in] offset file offset from the start where to read
@param[in] n number of bytes to read, starting from offset
@param[out] o number of bytes actually read
-@param[in] exit_on_err if true then exit on error
@return DB_SUCCESS or error code */
-static MY_ATTRIBUTE((warn_unused_result))
dberr_t
-os_file_read_page(
+os_file_read_func(
const IORequest& type,
os_file_t file,
void* buf,
os_offset_t offset,
ulint n,
- ulint* o,
- bool exit_on_err)
+ ulint* o)
{
- dberr_t err;
+ ut_ad(!type.node || type.node->handle == file);
+ ut_ad(n);
- os_bytes_read_since_printout += n;
+ os_bytes_read_since_printout+= n;
- ut_ad(n > 0);
+ dberr_t err;
+ ssize_t n_bytes= os_file_pread(type, file, buf, n, offset, &err);
- ssize_t n_bytes = os_file_pread(type, file, buf, n, offset, &err);
+ if (o)
+ *o= ulint(n_bytes);
- if (o) {
- *o = n_bytes;
- }
+ if (ulint(n_bytes) == n || err != DB_SUCCESS)
+ return err;
- if (ulint(n_bytes) == n || (err != DB_SUCCESS && !exit_on_err)) {
- return err;
- }
- int os_err = IF_WIN((int)GetLastError(), errno);
-
- if (!os_file_handle_error_cond_exit(
- NULL, "read", exit_on_err, false)) {
- ib::fatal()
- << "Tried to read " << n << " bytes at offset "
- << offset << ", but was only able to read " << n_bytes
- << ".Cannot read from file. OS error number "
- << os_err << ".";
- } else {
- ib::error() << "Tried to read " << n << " bytes at offset "
- << offset << ", but was only able to read " << n_bytes;
- }
- if (err == DB_SUCCESS) {
- err = DB_IO_ERROR;
- }
+ os_file_handle_error_cond_exit(type.node ? type.node->name : nullptr, "read",
+ false, false);
+ sql_print_error("InnoDB: Tried to read %zu bytes at offset %llu"
+ " of file %s, but was only able to read %zd",
+ n, offset, type.node ? type.node->name : "(unknown)",
+ n_bytes);
- return err;
+ return err ? err : DB_IO_ERROR;
}
/** Retrieves the last error number if an error occurs in a file io function.
@@ -3322,51 +3309,6 @@ os_file_truncate(
#endif /* _WIN32 */
}
-/** NOTE! Use the corresponding macro os_file_read(), not directly this
-function!
-Requests a synchronous positioned read operation.
-@return DB_SUCCESS if request was successful, DB_IO_ERROR on failure
-@param[in] type IO flags
-@param[in] file handle to an open file
-@param[out] buf buffer where to read
-@param[in] offset file offset from the start where to read
-@param[in] n number of bytes to read, starting from offset
-@return error code
-@retval DB_SUCCESS if the operation succeeded */
-dberr_t
-os_file_read_func(
- const IORequest& type,
- os_file_t file,
- void* buf,
- os_offset_t offset,
- ulint n)
-{
- return(os_file_read_page(type, file, buf, offset, n, NULL, true));
-}
-
-/** NOTE! Use the corresponding macro os_file_read_no_error_handling(),
-not directly this function!
-Requests a synchronous positioned read operation.
-@return DB_SUCCESS if request was successful, DB_IO_ERROR on failure
-@param[in] type IO flags
-@param[in] file handle to an open file
-@param[out] buf buffer where to read
-@param[in] offset file offset from the start where to read
-@param[in] n number of bytes to read, starting from offset
-@param[out] o number of bytes actually read
-@return DB_SUCCESS or error code */
-dberr_t
-os_file_read_no_error_handling_func(
- const IORequest& type,
- os_file_t file,
- void* buf,
- os_offset_t offset,
- ulint n,
- ulint* o)
-{
- return(os_file_read_page(type, file, buf, offset, n, o, false));
-}
-
/** Check the existence and type of the given file.
@param[in] path path name of file
@param[out] exists true if the file exists
@@ -3788,7 +3730,7 @@ dberr_t os_aio(const IORequest &type, void *buf, os_offset_t offset, size_t n)
if (!type.is_async()) {
err = type.is_read()
? os_file_read_func(type, type.node->handle,
- buf, offset, n)
+ buf, offset, n, nullptr)
: os_file_write_func(type, type.node->name,
type.node->handle,
buf, offset, n);
@@ -4149,10 +4091,10 @@ bool fil_node_t::read_page0()
if (!deferred)
{
page_t *page= static_cast<byte*>(aligned_malloc(psize, psize));
- if (os_file_read(IORequestRead, handle, page, 0, psize)
+ if (os_file_read(IORequestRead, handle, page, 0, psize, nullptr)
!= DB_SUCCESS)
{
- ib::error() << "Unable to read first page of file " << name;
+ sql_print_error("InnoDB: Unable to read first page of file %s", name);
corrupted:
aligned_free(page);
return false;
diff --git a/storage/innobase/row/row0import.cc b/storage/innobase/row/row0import.cc
index 40454c143d7..65c17a4e4b1 100644
--- a/storage/innobase/row/row0import.cc
+++ b/storage/innobase/row/row0import.cc
@@ -3087,9 +3087,8 @@ static dberr_t handle_instant_metadata(dict_table_t *table,
static_cast<byte *>(aligned_malloc(srv_page_size, srv_page_size)),
&aligned_free);
- if (dberr_t err= os_file_read_no_error_handling(IORequestReadPartial,
- file, first_page.get(), 0,
- srv_page_size, nullptr))
+ if (dberr_t err= os_file_read(IORequestReadPartial, file, first_page.get(),
+ 0, srv_page_size, nullptr))
return err;
auto space_flags= fsp_header_get_flags(first_page.get());
@@ -3127,7 +3126,7 @@ static dberr_t handle_instant_metadata(dict_table_t *table,
aligned_malloc(UNIV_PAGE_SIZE_MAX, UNIV_PAGE_SIZE_MAX)),
&aligned_free);
- if (dberr_t err= os_file_read_no_error_handling(
+ if (dberr_t err= os_file_read(
IORequestReadPartial, file, page.get(), 3 * physical_size,
physical_size, nullptr))
return err;
@@ -3184,10 +3183,8 @@ static dberr_t handle_instant_metadata(dict_table_t *table,
uint64_t child_page_no= btr_node_ptr_get_child_page_no(rec, offsets);
if (dberr_t err=
- os_file_read_no_error_handling(IORequestReadPartial, file,
- page.get(),
- child_page_no * physical_size,
- physical_size, nullptr))
+ os_file_read(IORequestReadPartial, file, page.get(),
+ child_page_no * physical_size, physical_size, nullptr))
return err;
if (dberr_t err= decrypt_decompress(space_crypt, space_flags,
@@ -3266,11 +3263,10 @@ static dberr_t handle_instant_metadata(dict_table_t *table,
&aligned_free);
if (dberr_t err=
- os_file_read_no_error_handling(IORequestReadPartial, file,
- second_page.get(), physical_size *
- mach_read_from_4(ptr +
- BTR_EXTERN_PAGE_NO),
- srv_page_size, nullptr))
+ os_file_read(IORequestReadPartial, file, second_page.get(),
+ physical_size *
+ mach_read_from_4(ptr + BTR_EXTERN_PAGE_NO),
+ physical_size, nullptr))
return err;
if (dberr_t err= decrypt_decompress(space_crypt, space_flags,
@@ -3682,8 +3678,8 @@ dberr_t FetchIndexRootPages::run(const fil_iterator_t& iter,
bool page_compressed= false;
- dberr_t err= os_file_read_no_error_handling(
- IORequestReadPartial, iter.file, readptr, 3 * size, size, 0);
+ dberr_t err= os_file_read(IORequestReadPartial, iter.file, readptr,
+ 3 * size, size, nullptr);
if (err != DB_SUCCESS)
{
ib::error() << iter.filepath << ": os_file_read() failed";
@@ -3803,9 +3799,8 @@ static dberr_t fil_iterate(
? iter.crypt_io_buffer : io_buffer;
byte* const writeptr = readptr;
- err = os_file_read_no_error_handling(
- IORequestReadPartial,
- iter.file, readptr, offset, n_bytes, 0);
+ err = os_file_read(IORequestReadPartial, iter.file, readptr,
+ offset, n_bytes, nullptr);
if (err != DB_SUCCESS) {
ib::error() << iter.filepath
<< ": os_file_read() failed";
@@ -4138,10 +4133,10 @@ fil_tablespace_iterate(
block->page.frame = page;
block->page.init(buf_page_t::UNFIXED + 1, page_id_t{~0ULL});
- /* Read the first page and determine the page and zip size. */
+ /* Read the first page and determine the page size. */
- err = os_file_read_no_error_handling(IORequestReadPartial,
- file, page, 0, srv_page_size, 0);
+ err = os_file_read(IORequestReadPartial, file, page, 0, srv_page_size,
+ nullptr);
if (err == DB_SUCCESS) {
err = callback.init(file_size, block);
diff --git a/storage/innobase/row/row0log.cc b/storage/innobase/row/row0log.cc
index 0689f9ca029..42e09ffd180 100644
--- a/storage/innobase/row/row0log.cc
+++ b/storage/innobase/row/row0log.cc
@@ -2600,9 +2600,9 @@ all_done:
byte* buf = index->online_log->head.block;
- if (os_file_read_no_error_handling(
- IORequestRead, index->online_log->fd,
- buf, ofs, srv_sort_buf_size, 0) != DB_SUCCESS) {
+ if (DB_SUCCESS
+ != os_file_read(IORequestRead, index->online_log->fd,
+ buf, ofs, srv_sort_buf_size, nullptr)) {
ib::error()
<< "Unable to read temporary file"
" for table " << index->table->name;
@@ -3520,9 +3520,9 @@ all_done:
byte* buf = index->online_log->head.block;
- if (os_file_read_no_error_handling(
- IORequestRead, index->online_log->fd,
- buf, ofs, srv_sort_buf_size, 0) != DB_SUCCESS) {
+ if (DB_SUCCESS
+ != os_file_read(IORequestRead, index->online_log->fd,
+ buf, ofs, srv_sort_buf_size, nullptr)) {
ib::error()
<< "Unable to read temporary file"
" for index " << index->name;
diff --git a/storage/innobase/row/row0merge.cc b/storage/innobase/row/row0merge.cc
index 7cc270b9fc9..7683c4dbedc 100644
--- a/storage/innobase/row/row0merge.cc
+++ b/storage/innobase/row/row0merge.cc
@@ -1258,11 +1258,11 @@ row_merge_read(
DBUG_LOG("ib_merge_sort", "fd=" << fd << " ofs=" << ofs);
DBUG_EXECUTE_IF("row_merge_read_failure", DBUG_RETURN(FALSE););
- const bool success = DB_SUCCESS == os_file_read_no_error_handling(
- IORequestRead, fd, buf, ofs, srv_sort_buf_size, 0);
+ const dberr_t err = os_file_read(
+ IORequestRead, fd, buf, ofs, srv_sort_buf_size, nullptr);
/* If encryption is enabled decrypt buffer */
- if (success && log_tmp_is_encrypted()) {
+ if (err == DB_SUCCESS && srv_encrypt_log) {
if (!log_tmp_block_decrypt(buf, srv_sort_buf_size,
crypt_buf, ofs)) {
DBUG_RETURN(false);
@@ -1277,11 +1277,7 @@ row_merge_read(
posix_fadvise(fd, ofs, srv_sort_buf_size, POSIX_FADV_DONTNEED);
#endif /* POSIX_FADV_DONTNEED */
- if (!success) {
- ib::error() << "Failed to read merge block at " << ofs;
- }
-
- DBUG_RETURN(success);
+ DBUG_RETURN(err == DB_SUCCESS);
}
/********************************************************************//**
@@ -3631,7 +3627,7 @@ static dberr_t row_merge_copy_blob_from_file(dtuple_t *tuple, mem_heap_t *heap,
byte *data= (byte*) mem_heap_alloc(heap, len);
if (dberr_t err= os_file_read(IORequestRead, blob_file->fd, data,
- offset, len))
+ offset, len, nullptr))
return err;
dfield_set_data(field, data, len);
}
diff --git a/storage/innobase/srv/srv0start.cc b/storage/innobase/srv/srv0start.cc
index 3189e1ac330..e4249b595d8 100644
--- a/storage/innobase/srv/srv0start.cc
+++ b/storage/innobase/srv/srv0start.cc
@@ -519,7 +519,8 @@ static uint32_t srv_undo_tablespace_open(bool create, const char *name,
{
page_t *page= static_cast<byte*>(aligned_malloc(srv_page_size,
srv_page_size));
- dberr_t err= os_file_read(IORequestRead, fh, page, 0, srv_page_size);
+ dberr_t err= os_file_read(IORequestRead, fh, page, 0, srv_page_size,
+ nullptr);
if (err != DB_SUCCESS)
{
err_exit: