--innodb-force-recovery

Overview

This is a command-line option for the mariadbd & mysqld commands (arg: Required).

In 11.4 ES, 10.6 ES, 10.6 CS, 10.5 ES, 10.5 CS:

Helps to save your data in case the disk image of the database becomes corrupt. Value 5 can return bogus data, and 6 can permanently corrupt data.

In 10.4 ES, 10.4 CS, 10.3 ES, 10.3 CS, 10.2 ES, 10.2 CS:

Helps to save your data in case the disk image of the database becomes corrupt.

See also: mariadbd & mysqld for MariaDB Enterprise Server 11.4, in 10.6 ES, in 10.5 ES, in 10.4 ES, in 10.3 ES, in 10.2 ES, in 10.6 CS, in 10.5 CS, in 10.4 CS, in 10.3 CS, and in 10.2 CS

USAGE

DETAILS

The default value of 0 means that InnoDB is running normally. The other values are for modes that are used for recovery purposes only and no data can be changed while a mode other than 0 is active.

The recovery mode behavior depends on the MariaDB server version, see the tables below for details.

Regardless of the version of the MariaDB server, the values 5 and 6 can lead to data corruption and should be used very carefully and only if you have a database backup.

Mode

Description

0

The default mode while InnoDB is running normally.

  • In MariaDB 10.5 and later: Write transactions are permitted with innodb_force_recovery<=4.

  • In MariaDB 10.4 and earlier: Write transactions are permitted with innodb_force_recovery<=3.

1

Allows the server to keep running even if corrupt pages are detected. It does so by making redo log based recovery ignore certain errors, such as missing data files or corrupted data pages. Any redo log for affected files or pages will be skipped. You can facilitate dumping tables by getting the SELECT * FROM table_name statement to jump over corrupt indexes and pages (SRV_FORCE_IGNORE_CORRUPT).

2

Stops the master thread from running, preventing a crash that occurs during a purge. No purge will be performed, so the undo logs will keep growing (SRV_FORCE_NO_BACKGROUND).

3

Does not roll back transactions after the crash recovery. Does not affect rollback of currently active transactions, also prevents some undo-generating background tasks from running. These tasks could hit a lock wait due to the recovered incomplete transactions whose rollback is being prevented (SRV_FORCE_NO_TRX_UNDO).

4

Does not calculate tables statistics and prevents insert buffer merges (SRV_FORCE_NO_IBUF_MERGE).

  • In MariaDB 10.5 - 10.6.4: The same as 3.

  • In MariaDB 10.6.5 and later: Does not roll back transactions after the crash recovery. Does not affect rollback of currently active transactions. Will also prevent some undo-generating background tasks from running. These tasks could hit a lock wait due to the recovered incomplete transactions whose rollback is being prevented (SRV_FORCE_NO_DDL_UNDO).

5

Treats incomplete transactions as committed, and does not look at the undo logs when starting (SRV_FORCE_NO_UNDO_LOG_SCAN).

  • In MariaDB 10.6.5 and later: Additionally, any DDL log for InnoDB tables will be essentially ignored by InnoDB, but the server will start up.

6

Does not perform redo log roll-forward as part of recovery. Running queries that require indexes are likely to fail with this mode active. However, if a table dump still causes a crash, you can try using a SELECT * FROM tab ORDER BY primary_key DESC to dump all the data portion after the corrupted part (SRV_FORCE_NO_LOG_REDO).

SYNONYMS

SCHEMA

PARAMETERS

SKYSQL

PRIVILEGES

EXAMPLES

ERROR HANDLING

FEATURE INTERACTION

RESPONSES

DIAGNOSIS

ISO 9075:2016

CHANGE HISTORY

Release Series

History

11.4 Enterprise

  • Present starting in MariaDB Enterprise Server 11.4.3-1.

10.6 Enterprise

  • Present starting in MariaDB Enterprise Server 10.6.4-1.

10.6 Community

  • Present starting in MariaDB Community Server 10.6.0.

10.5 Enterprise

  • Present starting in MariaDB Enterprise Server 10.5.3-1.

10.5 Community

  • Present starting in MariaDB Community Server 10.5.0.

10.4 Enterprise

  • Present starting in MariaDB Enterprise Server 10.4.6-1.

10.4 Community

  • Present starting in MariaDB Community Server 10.4.0.

10.3 Enterprise

  • Present starting in MariaDB Enterprise Server 10.3.16-1.

10.3 Community

  • Present starting in MariaDB Community Server 10.3.0.

10.2 Enterprise

  • Present starting in MariaDB Enterprise Server 10.2.25-1.

10.2 Community

  • Present starting in MariaDB Community Server 10.2.0.

EXTERNAL REFERENCES