diff options
author | Monty <monty@mariadb.org> | 2022-03-31 15:40:17 +0300 |
---|---|---|
committer | Monty <monty@mariadb.org> | 2022-03-31 15:40:17 +0300 |
commit | 69be3c13b66f75a0f093b0685d28ea793266b172 (patch) | |
tree | 797d9dc832f56dd238578d46a3b06e542f7b998d /storage | |
parent | 2eaaa8874fbc5212a3813e150d437b36ec34f22e (diff) | |
download | mariadb-git-69be3c13b66f75a0f093b0685d28ea793266b172.tar.gz |
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
Diffstat (limited to 'storage')
-rw-r--r-- | storage/maria/ma_loghandler.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/storage/maria/ma_loghandler.c b/storage/maria/ma_loghandler.c index 9de4480062b..8455cbb80de 100644 --- a/storage/maria/ma_loghandler.c +++ b/storage/maria/ma_loghandler.c @@ -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 |