[MDEV-15418] innodb_force_recovery=5 displays bogus warnings about too new transaction identifier Created: 2018-02-25  Updated: 2021-06-09  Resolved: 2018-03-07

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - InnoDB
Affects Version/s: 10.3.5
Fix Version/s: 10.3.6

Type: Bug Priority: Major
Reporter: Marko Mäkelä Assignee: Marko Mäkelä
Resolution: Fixed Votes: 0
Labels: recovery, regression, warning

Issue Links:
Problem/Incident
is caused by MDEV-15132 Avoid accessing the TRX_SYS page Closed
Relates
relates to MDEV-25886 CHECK TABLE crashes due to DB_MISSING... Closed
relates to MDEV-18952 CHECK TABLE should use READ UNCOMMITE... Closed

 Description   

With MDEV-15132 in MariaDB 10.3.5, InnoDB no longer writes the transaction identifier to the TRX_SYS page. The information is only written to undo log headers. Because the setting innodb_force_recovery=5 will skip reading any undo logs, the maximum transaction identifier cannot be determined.

Because of this, the following kind of warning messages are bogus and should be suppressed when running with innodb_force_recovery set to 5 or 6:

CURRENT_TEST: innodb.innodb_force_recovery
--- /usr/share/mysql-test/suite/innodb/r/innodb_force_recovery.result	2018-02-24 20:33:04.000000000 +0000
+++ /dev/shm/var/1/log/innodb_force_recovery.reject	2018-02-25 00:10:34.038752342 +0000
@@ -34,7 +34,8 @@
 # Restart the server with innodb_force_recovery as 5.
 select * from t2;
 f1	f2
-1	2
+Warnings:
+Warning	1642	InnoDB: Transaction id in a record of table `test`.`t2` is newer than system-wide maximum.
 insert into t2 values(2, 3);
 ERROR HY000: Running in read-only mode
 alter table t2 add f3 int not null, algorithm=copy;
 
mysqltest: Result length mismatch



 Comments   
Comment by Marko Mäkelä [ 2018-02-25 ]

An appropriate fix would seem to be to use the READ UNCOMMITTED isolation level when innodb_force_recovery is set to 5 or more, regardless of the user-specified transaction isolation level. Since MariaDB 10.2 (along with upstream MySQL 5.7), InnoDB already does this for innodb_read_only=1.

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