Commit fbd11d5f authored by Daniel Black's avatar Daniel Black

MDEV-18200 MariaBackup full backup failed with InnoDB: Failing assertion: success

Review cleanups.
parent c79ca7c7
......@@ -503,13 +503,16 @@ struct log_t{
void write_header_durable(lsn_t lsn);
/** opens log file which must be closed prior this call */
dberr_t rename(std::string path) { return fd.rename(path); }
MY_ATTRIBUTE((warn_unused_result))
/** reads buffer from log file
@param[in] offset offset in log file
@param[in] buf buffer where to read */
dberr_t MY_ATTRIBUTE((warn_unused_result)) read(os_offset_t offset,
span<byte> buf);
dberr_t read(os_offset_t offset, span<byte> buf)
{ return fd.read(offset, buf); }
/** Tells whether writes require calling flush() */
bool writes_are_durable() const noexcept;
bool writes_are_durable() const noexcept
{ return fd.writes_are_durable(); }
/** writes buffer to log file
@param[in] offset offset in log file
@param[in] buf buffer from which to write */
......
......@@ -514,17 +514,6 @@ void log_t::file::write_header_durable(lsn_t lsn)
log_sys.log.flush();
}
__attribute__((warn_unused_result))
dberr_t log_t::file::read(os_offset_t offset, span<byte> buf)
{
return fd.read(offset, buf);
}
bool log_t::file::writes_are_durable() const noexcept
{
return fd.writes_are_durable();
}
void log_t::file::write(os_offset_t offset, span<byte> buf)
{
srv_stats.os_log_pending_writes.inc();
......
......@@ -763,8 +763,7 @@ void recv_sys_t::open_log_files_if_needed()
}
MY_ATTRIBUTE((warn_unused_result))
dberr_t
recv_sys_t::read(os_offset_t total_offset, span<byte> buf)
dberr_t recv_sys_t::read(os_offset_t total_offset, span<byte> buf)
{
open_log_files_if_needed();
......@@ -1274,7 +1273,6 @@ inline uint32_t log_block_calc_checksum_format_0(const byte *b)
ATTRIBUTE_COLD static dberr_t recv_log_recover_pre_10_2()
{
uint64_t max_no= 0;
dberr_t err;
byte *buf= log_sys.buf;
ut_ad(log_sys.log.format == 0);
......@@ -1298,7 +1296,7 @@ ATTRIBUTE_COLD static dberr_t recv_log_recover_pre_10_2()
for (ulint field= LOG_CHECKPOINT_1; field <= LOG_CHECKPOINT_2;
field += LOG_CHECKPOINT_2 - LOG_CHECKPOINT_1)
{
if ((err= log_sys.log.read(field, {buf, OS_FILE_LOG_BLOCK_SIZE})))
if (dberr_t err= log_sys.log.read(field, {buf, OS_FILE_LOG_BLOCK_SIZE}))
return err;
if (static_cast<uint32_t>(ut_fold_binary(buf, CHECKSUM_1)) !=
......@@ -1351,7 +1349,7 @@ ATTRIBUTE_COLD static dberr_t recv_log_recover_pre_10_2()
"InnoDB: Upgrade after a crash is not supported."
" This redo log was created before MariaDB 10.2.2";
if ((err= recv_sys.read(source_offset & ~511, {buf, 512})))
if (dberr_t err= recv_sys.read(source_offset & ~511, {buf, 512}))
return err;
if (log_block_calc_checksum_format_0(buf) != log_block_get_checksum(buf) &&
......@@ -1419,7 +1417,8 @@ static dberr_t recv_log_recover_10_4()
return DB_CORRUPTION;
}
if (dberr_t err= recv_sys.read(source_offset & ~lsn_t(OS_FILE_LOG_BLOCK_SIZE - 1),
if (dberr_t err=
recv_sys.read(source_offset & ~lsn_t(OS_FILE_LOG_BLOCK_SIZE - 1),
{buf, OS_FILE_LOG_BLOCK_SIZE}))
return err;
......
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