summaryrefslogtreecommitdiff
path: root/storage/innobase/log/log0log.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2017-09-11 16:47:23 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2017-09-12 11:32:49 +0300
commit66a09bd6aba0f7b74492d198146bb8d47cdd9dbb (patch)
treee657de3adc503b0f1d2b920b4652e1ceb906e6ae /storage/innobase/log/log0log.cc
parent8ee4b414ae071b1c666b97bac1808bc67a260e78 (diff)
downloadmariadb-git-66a09bd6aba0f7b74492d198146bb8d47cdd9dbb.tar.gz
MDEV-13318 Crash recovery failure after the server is killed during innodb_encrypt_log startup
This fixes several InnoDB bugs related to innodb_encrypt_log and two Mariabackup --backup bugs. log_crypt(): Properly derive the initialization vector from the start LSN of each block. Add a debug assertion. log_crypt_init(): Note that the function should only be used when creating redo log files and that the information is persisted in the checkpoint pages. xtrabackup_copy_log(): Validate data_len. xtrabackup_backup_func(): Always use the chosen checkpoint buffer. log_group_write_buf(), log_write_up_to(): Only log_crypt() the redo log payload, not the padding bytes. innobase_start_or_create_for_mysql(): Do not invoke log_crypt_init() or initiate a redo log checkpoint. recv_find_max_checkpoint(): Return the contents of LOG_CHECKPOINT_NO to xtrabackup_backup_func() in log_sys->next_checkpoint_no.
Diffstat (limited to 'storage/innobase/log/log0log.cc')
-rw-r--r--storage/innobase/log/log0log.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/storage/innobase/log/log0log.cc b/storage/innobase/log/log0log.cc
index 463914982cf..f7974d243d8 100644
--- a/storage/innobase/log/log0log.cc
+++ b/storage/innobase/log/log0log.cc
@@ -997,10 +997,6 @@ loop:
|| log_block_get_hdr_no(buf)
== log_block_convert_lsn_to_no(start_lsn));
- if (log_sys->is_encrypted()) {
- log_crypt(buf, write_len);
- }
-
/* Calculate the checksums for each log block and write them to
the trailer fields of the log blocks */
@@ -1264,6 +1260,12 @@ loop:
::memset(write_buf + area_end, 0, pad_size);
}
}
+
+ if (log_sys->is_encrypted()) {
+ log_crypt(write_buf + area_start, log_sys->write_lsn,
+ area_end - area_start);
+ }
+
/* Do the write to the log files */
log_group_write_buf(
&log_sys->log, write_buf + area_start,