summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2022-11-30 12:06:52 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2022-11-30 12:06:52 +0200
commit4783f37cf79150db55a7258683e50a04d987af1d (patch)
tree6d3b5574c34196a4bf93a6b468ba3973ce94f0b1
parent15ab2e122da0ce17853a8f9fd0ac720701c8672a (diff)
downloadmariadb-git-4783f37cf79150db55a7258683e50a04d987af1d.tar.gz
MDEV-30069 fixup: Do not truncate files on recovery
recv_sys_t::recover_deferred(): If the file has been determined to be large enough, skip the call to os_file_set_size(), which would use the current value of FSP_SIZE, which during a multi-batch recovery can be smaller than the actual file size. os_file_io(): Also display the file offset in the warning message about partial I/O.
-rw-r--r--storage/innobase/log/log0recv.cc2
-rw-r--r--storage/innobase/os/os0file.cc5
2 files changed, 5 insertions, 2 deletions
diff --git a/storage/innobase/log/log0recv.cc b/storage/innobase/log/log0recv.cc
index 3dcc7e54ab0..b0651d8b8da 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 c67d0b50217..44783f72972 100644
--- a/storage/innobase/os/os0file.cc
+++ b/storage/innobase/os/os0file.cc
@@ -2770,10 +2770,11 @@ os_file_io(
if (type.type != IORequest::READ_MAYBE_PARTIAL) {
sql_print_warning("InnoDB: %zu bytes should have been"
- " %s from %s, but got only %zd."
+ " %s at %llu from %s,"
+ " but got only %zd."
" Retrying.",
n, type.is_read()
- ? "read" : "written",
+ ? "read" : "written", offset,
type.node
? type.node->name
: "(unknown file)", bytes_returned);