Skip to content

Commit 69be3c1

Browse files
committed
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
1 parent 2eaaa88 commit 69be3c1

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

storage/maria/ma_loghandler.c

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8936,20 +8936,23 @@ void translog_hard_group_commit(my_bool mode)
89368936

89378937
void translog_sync()
89388938
{
8939-
uint32 max= get_current_logfile()->number;
8940-
uint32 min;
89418939
DBUG_ENTER("ma_translog_sync");
89428940

8943-
min= soft_sync_min;
8944-
if (!min)
8945-
min= max;
8941+
/* The following is only true if initalization of translog succeded */
8942+
if (log_descriptor.open_files.elements != 0)
8943+
{
8944+
uint32 max= get_current_logfile()->number;
8945+
uint32 min;
89468946

8947-
translog_sync_files(min, max, sync_log_dir >= TRANSLOG_SYNC_DIR_ALWAYS);
8947+
min= soft_sync_min;
8948+
if (!min)
8949+
min= max;
89488950

8951+
translog_sync_files(min, max, sync_log_dir >= TRANSLOG_SYNC_DIR_ALWAYS);
8952+
}
89498953
DBUG_VOID_RETURN;
89508954
}
89518955

8952-
89538956
/**
89548957
@brief set rate for group commit
89558958

0 commit comments

Comments
 (0)