Commit 69be3c13 authored by Monty's avatar Monty

Fixed unlikely assert/crash if initialization of translog failed

This was noticed as part of verifying
MDEV-28186 "crash on startup after crash while regular use"
but is probably not related to the users issue.
Still good to have it fixed
parent 2eaaa887
......@@ -8936,20 +8936,23 @@ void translog_hard_group_commit(my_bool mode)
void translog_sync()
{
uint32 max= get_current_logfile()->number;
uint32 min;
DBUG_ENTER("ma_translog_sync");
min= soft_sync_min;
if (!min)
min= max;
/* The following is only true if initalization of translog succeded */
if (log_descriptor.open_files.elements != 0)
{
uint32 max= get_current_logfile()->number;
uint32 min;
translog_sync_files(min, max, sync_log_dir >= TRANSLOG_SYNC_DIR_ALWAYS);
min= soft_sync_min;
if (!min)
min= max;
translog_sync_files(min, max, sync_log_dir >= TRANSLOG_SYNC_DIR_ALWAYS);
}
DBUG_VOID_RETURN;
}
/**
@brief set rate for group commit
......
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