Commit 4783f37c authored by Marko Mäkelä's avatar Marko Mäkelä

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.
parent 15ab2e12
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment