Make IF clear.

This commit is contained in:
Oleksandr Byelkin 2017-05-18 19:31:44 +02:00
parent b5cdf01404
commit 4a846e018d

View File

@ -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)