[MDEV-27390] InnoDB: Corruption of an index tree Created: 2021-12-30  Updated: 2021-12-30

Status: Open
Project: MariaDB Server
Component/s: Server
Affects Version/s: 10.4.19, 10.4.20, 10.4.21, 10.4.22, 10.5.13, 10.6.5
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Andrija Vucinic Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Environment:

Ubuntu 20.04.3 LTS
Installed the above versions from repo: deb http://archive.mariadb.org/mariadb-10.*/repo/ubuntu/ focal main


Attachments: HTML File error log    

 Description   

Recently we had mariadb (10.4.22) crash in a loop. The cause seems to be an index corruption. We exported the binlogs for this specific DB, and were able to consistently reproduce (tho cannot share the binlogs because of sensitive data) but were unable to produce a small test case.

Database in corrupted state, but before crash:

MariaDB [test]> select option_id,hex(option_name) from wp_options where option_id in(19269,74606) order by option_name asc\G
*************************** 1. row ***************************
       option_id: 19269
hex(option_name): 77705F696E7374616C6C65725F73657474696E6773
*************************** 2. row ***************************
       option_id: 74606
hex(option_name): 77705F696E7374616C6C65725F73657474696E6773
2 rows in set (0.000 sec)
 
MariaDB [test]> show create table wp_options\G
*************************** 1. row ***************************
       Table: wp_options
Create Table: CREATE TABLE `wp_options` (
  `option_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `option_name` varchar(191) NOT NULL DEFAULT '',
  `option_value` longtext NOT NULL,
  `autoload` varchar(20) NOT NULL DEFAULT 'yes',
  PRIMARY KEY (`option_id`),
  UNIQUE KEY `option_name` (`option_name`),
  KEY `autoload` (`autoload`)
) ENGINE=InnoDB AUTO_INCREMENT=74609 DEFAULT CHARSET=utf8mb4
1 row in set (0.000 sec)

Replaying the same binlogs on 10.3.32 or 10.4.18 doesn't corrupt the index. Instead, it stops with a duplicate entry error:

ERROR 1062 (23000) at line 23811001: Duplicate entry 'wp_installer_settings' for key 'option_name'


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