Commit 9d10b710 authored by Monty's avatar Monty

Fixed bug in ma_loghandler.cc that could cause an assert

The assert happens in 10.6 with the following command:

./mtr --no-reorder --verbose-restart main.update_ignore_216 main.upgrade_MDEV-19650 main.upgrade_MDEV-23102-1 main.upgrade_MDEV-23102-2 main.upgrade_geometrycolumn_procedure_definer main.upgrade_mdev_24363 main.varbinary sys_vars.aria_log_file_size_basic

Reviewer: Oleksandr Byelkin <sanja@mariadb.com>
parent 131c318b
......@@ -7993,22 +7993,14 @@ void translog_flush_buffers(TRANSLOG_ADDRESS *lsn,
}
else
{
if (log_descriptor.bc.buffer->last_lsn == LSN_IMPOSSIBLE)
if (log_descriptor.bc.buffer->last_lsn == LSN_IMPOSSIBLE &&
log_descriptor.bc.buffer->prev_last_lsn == LSN_IMPOSSIBLE)
{
/*
In this case both last_lsn & prev_last_lsn are LSN_IMPOSSIBLE
otherwise it will go in the first IF because LSN_IMPOSSIBLE less
then any real LSN and cmp_translog_addr(*lsn,
log_descriptor.bc.buffer->prev_last_lsn) will be TRUE
*/
DBUG_ASSERT(log_descriptor.bc.buffer->prev_last_lsn ==
LSN_IMPOSSIBLE);
DBUG_PRINT("info", ("There is no LSNs yet generated => do nothing"));
translog_unlock();
DBUG_VOID_RETURN;
}
DBUG_ASSERT(log_descriptor.bc.buffer->prev_last_lsn != LSN_IMPOSSIBLE);
/* fix lsn if it was horizon */
*lsn= log_descriptor.bc.buffer->prev_last_lsn;
DBUG_PRINT("info", ("LSN to flush fixed to prev last lsn: " LSN_FMT,
......
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