Commit 4a846e01 authored by Oleksandr Byelkin's avatar Oleksandr Byelkin

Make IF clear.

parent b5cdf014
......@@ -7814,8 +7814,24 @@ void translog_flush_buffers(TRANSLOG_ADDRESS *lsn,
translog_force_current_buffer_to_finish();
translog_buffer_unlock(buffer);
}
else if (log_descriptor.bc.buffer->prev_last_lsn != LSN_IMPOSSIBLE)
else
{
if (log_descriptor.bc.buffer->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: (%lu,0x%lx)",
......@@ -7824,13 +7840,6 @@ void translog_flush_buffers(TRANSLOG_ADDRESS *lsn,
TRANSLOG_BUFFERS_NO);
translog_unlock();
}
else if (log_descriptor.bc.buffer->last_lsn == LSN_IMPOSSIBLE)
{
DBUG_PRINT("info", ("There is no LSNs yet generated => do nothing"));
translog_unlock();
DBUG_VOID_RETURN;
}
/* flush buffers */
*sent_to_disk= translog_get_sent_to_disk();
if (cmp_translog_addr(*lsn, *sent_to_disk) > 0)
......
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