[MDEV-13044] Do not create a redo log checkpoint at startup Created: 2017-06-09  Updated: 2017-11-07  Resolved: 2017-11-07

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - InnoDB
Affects Version/s: 10.1, 10.2
Fix Version/s: 10.2.9, 10.3.2

Type: Bug Priority: Major
Reporter: Marko Mäkelä Assignee: Marko Mäkelä
Resolution: Fixed Votes: 0
Labels: corruption, encryption, performance, recovery

Issue Links:
Relates
relates to MDEV-13318 Crash recovery failure after the serv... Closed
relates to MDEV-8041 InnoDB redo log encryption Closed
relates to MDEV-9422 Encrypted redo log checksum errors on... Closed
relates to MDEV-12041 Implement key rotation for innodb_enc... Closed

 Description   

At startup, InnoDB is creating a redo log checkpoint.
This is not only slowing down the InnoDB startup. It is also potentially hiding crash recovery bugs, because crash recovery is only processing the redo log records starting from the latest checkpoint.

If the checkpoint is removed from InnoDB in 10.2, at least the following tests fail: encryption.innodb-redo-badkey encryption.innodb_encryption

diff --git a/storage/innobase/srv/srv0start.cc b/storage/innobase/srv/srv0start.cc
index cdd569b9f4c..bb01c612a4a 100644
--- a/storage/innobase/srv/srv0start.cc
+++ b/storage/innobase/srv/srv0start.cc
@@ -2722,13 +2722,6 @@ innobase_start_or_create_for_mysql(void)
 		fil_crypt_threads_init();
 		fil_system_exit();
 
-		/*
-		  Create a checkpoint before logging anything new, so that
-		  the current encryption key in use is definitely logged
-		  before any log blocks encrypted with that key.
-		*/
-		log_make_checkpoint_at(LSN_MAX, TRUE);
-
 		/* Init data for datafile scrub threads */
 		btr_scrub_init();
 

In 10.1, all encryption tests pass even after the code is removed, but this could also be because the tests are less extensive in 10.1 than in 10.2.

The code was originally added in MDEV-8041, apparently to work around fundamental problems in redo log encryption key rotation, which was finally disabled in MDEV-9422. (MDEV-12041 was filed for re-enabling it.)



 Comments   
Comment by Marko Mäkelä [ 2017-11-07 ]

It looks like the extra checkpoint was added to work around the problem that was fixed in MDEV-13318. The unnecessary checkpoint was removed as part of the MDEV-13318 fix.

Generated at Thu Feb 08 08:02:27 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.