summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2021-12-07 17:00:46 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2021-12-07 17:00:46 +0200
commitcfcfdc65dfa0ae5e59df1f1c42ee574b8bdc60a4 (patch)
tree3729319e52c299b11cd6143ccc6e05b269975816
parent890c55177df3d6b92fa90c7cb49c909fcbe9ef4c (diff)
downloadmariadb-git-cfcfdc65dfa0ae5e59df1f1c42ee574b8bdc60a4.tar.gz
MDEV-27190 InnoDB upgrade from 10.2, 10.3, 10.4 is not crash-safe
During startup, InnoDB must write a FILE_CHECKPOINT record. However, before MDEV-12353 (in MariaDB Server 10.2, 10.3, 10.4) the corresponding record MLOG_CHECKPOINT was encoded in a different way. When we are upgrading from a logically empty 10.2, 10.3, or 10.4 redo log, we must not write anything to the old log file, because if the server were killed during the upgrade, we would end up with a corrupted log file, and both the old and the new server would refuse to start up. On upgrade, we must simply create a new logically empty log file and replace the old ib_logfile0 with that.
-rw-r--r--storage/innobase/log/log0recv.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/storage/innobase/log/log0recv.cc b/storage/innobase/log/log0recv.cc
index 3e8986d4651..dfadd9df37f 100644
--- a/storage/innobase/log/log0recv.cc
+++ b/storage/innobase/log/log0recv.cc
@@ -3661,7 +3661,9 @@ completed:
log_sys.last_checkpoint_lsn = checkpoint_lsn;
- if (!srv_read_only_mode && srv_operation == SRV_OPERATION_NORMAL) {
+ if (!srv_read_only_mode && srv_operation == SRV_OPERATION_NORMAL
+ && (~log_t::FORMAT_ENCRYPTED & log_sys.log.format)
+ == log_t::FORMAT_10_5) {
/* Write a FILE_CHECKPOINT marker as the first thing,
before generating any other redo log. This ensures
that subsequent crash recovery will be possible even