Skip to content
Permalink
Browse files
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.
  • Loading branch information
dr-m committed Nov 30, 2022
1 parent 15ab2e1 commit 4783f37
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
@@ -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;
@@ -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);

0 comments on commit 4783f37

Please sign in to comment.