Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
10.6, 10.11
Description
While testing MDEV-34830, mleich encountered a case where a ROW_FORMAT=COMPRESSED table is being recovered incorrectly in a multi-batch recovery.
I can reproduce the corruption. Unfortunately, the data set is partially encrypted and a compressed copy of it would be too large to be attached in Jira. I even tried to reduce the archive by omitting some tables, but I could not get it below the 10MiB limit.
$BUILD/sql/mariadbd --innodb-buffer-pool-size=5m --plugin-dir=$BUILD/plugin/file_key_management --plugin-load-add=file_key_management.so --innodb-page-size=4k --file-key-management-filename=/dev/shm/encryption_keys.txt --datadir /dev/shm/data
|
10.6 2ed33f2fb660617aa39d4abb7e7383764e63ac8c |
2024-09-05 14:44:31 0 [Note] InnoDB: Starting crash recovery from checkpoint LSN=69313049,77981397
|
2024-09-05 14:44:31 0 [Note] InnoDB: Ignoring data file './test/#sql-alter-cdb92-1a.ibd' with space ID 57. Another data file called ./test/t8.ibd exists with the same space ID.
|
2024-09-05 14:44:31 0 [Note] InnoDB: Ignoring data file './test/#sql-alter-cdb92-25.ibd' with space ID 72. Another data file called ./test/t4.ibd exists with the same space ID.
|
2024-09-05 14:44:31 0 [Note] InnoDB: Ignoring data file './test/#sql-alter-cdb92-25.ibd' with space ID 72. Another data file called ./test/t4.ibd exists with the same space ID.
|
2024-09-05 14:44:31 0 [Note] InnoDB: Multi-batch recovery needed at LSN 71640495
|
2024-09-05 14:44:31 0 [Note] InnoDB: Ignoring data file './test/#sql-alter-cdb92-25.ibd' with space ID 72. Another data file called ./test/t4.ibd exists with the same space ID.
|
2024-09-05 14:44:31 0 [Note] InnoDB: Ignoring data file './test/#sql-alter-cdb92-1a.ibd' with space ID 57. Another data file called ./test/t8.ibd exists with the same space ID.
|
2024-09-05 14:44:31 0 [Note] InnoDB: Ignoring data file './test/#sql-alter-cdb92-25.ibd' with space ID 76. Another data file called ./test/t5.ibd exists with the same space ID.
|
2024-09-05 14:44:31 0 [Note] InnoDB: Ignoring data file './test/#sql-alter-cdb92-25.ibd' with space ID 76. Another data file called ./test/t5.ibd exists with the same space ID.
|
2024-09-05 14:44:31 0 [Note] InnoDB: Ignoring data file './test/#sql-alter-cdb92-2a.ibd' with space ID 78. Another data file called ./test/t2.ibd exists with the same space ID.
|
2024-09-05 14:44:31 0 [Note] InnoDB: Ignoring data file './test/#sql-alter-cdb92-2a.ibd' with space ID 78. Another data file called ./test/t2.ibd exists with the same space ID.
|
2024-09-05 14:44:31 0 [Note] InnoDB: Ignoring data file './test/#sql-alter-cdb92-25.ibd' with space ID 76. Another data file called ./test/t5.ibd exists with the same space ID.
|
2024-09-05 14:44:31 0 [Note] InnoDB: Ignoring data file './test/#sql-alter-cdb92-2a.ibd' with space ID 78. Another data file called ./test/t2.ibd exists with the same space ID.
|
2024-09-05 14:44:32 0 [Note] InnoDB: Ignoring data file './test/#sql-alter-cdb92-1a.ibd' with space ID 57. Another data file called ./test/t8.ibd exists with the same space ID.
|
2024-09-05 14:44:32 0 [Note] InnoDB: Ignoring data file './test/#sql-alter-cdb92-24.ibd' with space ID 71. Another data file called ./test/t7.ibd exists with the same space ID.
|
2024-09-05 14:44:32 0 [Note] InnoDB: Ignoring data file './test/#sql-alter-cdb92-25.ibd' with space ID 72. Another data file called ./test/t4.ibd exists with the same space ID.
|
2024-09-05 14:44:32 0 [Note] InnoDB: Ignoring data file './test/#sql-alter-cdb92-25.ibd' with space ID 72. Another data file called ./test/t4.ibd exists with the same space ID.
|
2024-09-05 14:44:32 0 [Note] InnoDB: Ignoring data file './test/#sql-alter-cdb92-25.ibd' with space ID 72. Another data file called ./test/t4.ibd exists with the same space ID.
|
2024-09-05 14:44:32 0 [Note] InnoDB: To recover: LSN 71968140/71983616; 641 pages
|
2024-09-05 14:44:32 0 [Note] InnoDB: Ignoring data file './test/#sql-alter-cdb92-1a.ibd' with space ID 57. Another data file called ./test/t8.ibd exists with the same space ID.
|
2024-09-05 14:44:32 0 [Note] InnoDB: Ignoring data file './test/#sql-alter-cdb92-25.ibd' with space ID 76. Another data file called ./test/t5.ibd exists with the same space ID.
|
2024-09-05 14:44:32 0 [Note] InnoDB: Ignoring data file './test/#sql-alter-cdb92-25.ibd' with space ID 76. Another data file called ./test/t5.ibd exists with the same space ID.
|
2024-09-05 14:44:32 0 [Note] InnoDB: To recover: LSN 74921892/74932736; 671 pages
|
2024-09-05 14:44:33 0 [Note] InnoDB: Ignoring data file './test/#sql-alter-cdb92-2a.ibd' with space ID 78. Another data file called ./test/t2.ibd exists with the same space ID.
|
2024-09-05 14:44:33 0 [Note] InnoDB: Ignoring data file './test/#sql-alter-cdb92-2a.ibd' with space ID 78. Another data file called ./test/t2.ibd exists with the same space ID.
|
2024-09-05 14:44:33 0 [Note] InnoDB: Ignoring data file './test/#sql-alter-cdb92-25.ibd' with space ID 76. Another data file called ./test/t5.ibd exists with the same space ID.
|
2024-09-05 14:44:33 0 [Note] InnoDB: Ignoring data file './test/#sql-alter-cdb92-2a.ibd' with space ID 78. Another data file called ./test/t2.ibd exists with the same space ID.
|
2024-09-05 14:44:33 0 [Note] InnoDB: To recover: LSN 77424997/77439488; 688 pages
|
2024-09-05 14:44:33 0 [Note] InnoDB: Ignoring data file './test/#sql-alter-cdb92-24.ibd' with space ID 71. Another data file called ./test/t7.ibd exists with the same space ID.
|
2024-09-05 14:44:33 0 [Note] InnoDB: Ignoring data file './test/#sql-alter-cdb92-24.ibd' with space ID 71. Another data file called ./test/t7.ibd exists with the same space ID.
|
2024-09-05 14:44:33 0 [Note] InnoDB: To recover: LSN 80025251/80044544; 691 pages
|
2024-09-05 14:44:33 0 [Note] InnoDB: Opened 3 undo tablespaces
|
2024-09-05 14:44:33 0 [Warning] InnoDB: innodb_undo_tablespaces=0 disables dedicated undo log tablespaces
|
2024-09-05 14:44:33 0 [Note] InnoDB: To recover: 306 pages
|
2024-09-05 14:44:33 0 [Note] InnoDB: Last binlog file './mysql-bin.000001', position 1698901
|
2024-09-05 14:44:33 0 [Note] InnoDB: 128 rollback segments in 3 undo tablespaces are active.
|
2024-09-05 14:44:33 0 [Note] InnoDB: Removed temporary tablespace data file: "./ibtmp1"
|
2024-09-05 14:44:33 0 [Note] InnoDB: Creating shared tablespace for temporary tables
|
2024-09-05 14:44:33 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
|
2024-09-05 14:44:33 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
|
2024-09-05 14:44:33 0 [Note] InnoDB: 10.6.20 started; log sequence number 81173989; transaction id 703
|
2024-09-05 14:44:33 0 [Note] InnoDB: Loading buffer pool(s) from /dev/shm/data/ib_buffer_pool
|
2024-09-05 14:44:33 0 [Note] Plugin 'FEEDBACK' is disabled.
|
2024-09-05 14:44:33 0 [Note] InnoDB: Buffer pool(s) load completed at 240905 14:44:33
|
2024-09-05 14:44:33 0 [Note] DDL_LOG: Crash recovery executed 8 entries
|
2024-09-05 14:44:33 0 [Note] Server socket created on IP: '0.0.0.0'.
|
2024-09-05 14:44:33 0 [Note] Server socket created on IP: '::'.
|
2024-09-05 14:44:33 0 [Note] /mariadb/10.6/build/sql/mariadbd: ready for connections.
|
Version: '10.6.20-MariaDB' socket: '/dev/shm/murjutuupa' port: 3306 Source distribution
|
2024-09-05 14:44:34 3 [ERROR] InnoDB: Flagged corruption of `k` in table `test`.`t4` in CHECK TABLE; Wrong count
|
If I start up the server on the same copy of the data directory with a larger innodb_buffer_pool_size, then CHECK TABLE will report no error.
Attachments
Issue Links
- is caused by
-
MDEV-27058 Buffer page descriptors are too large
-
- Closed
-
- relates to
-
MDEV-27734 Set innodb_change_buffering=none by default
-
- Closed
-
-
MDEV-34830 LSN in the future is not being treated as serious corruption
-
- Closed
-
It looks like the secondary index root (page 4 of tablespace 0x48) would be recovered correctly, but the PAGE_LEVEL is 1, that is, the index consists of multiple pages. At the time of buf_pool_t::close() on server shutdown, the compressed copy of the secondary index page is identical between a failing and a succeeding run. For the uncompressed root page there is a insignificant difference, in the page checksum field (bytes 0‥3) that only matters on the compressed page. I went on to compare the leaf pages 0x3d, 0x3e, 0x3f, 0x40 between the good and bad recovery. For all uncompressed pages there was the insignificant checksum difference. For one leaf page, there was a significant difference:
diff -u <(od -Ax -t x1 /dev/shm/good-3e.bin) <(od -Ax -t x1 /dev/shm/bad-3e.bin)
--- /dev/fd/63 2024-09-06 16:06:10.619400726 +0300
+++ /dev/fd/62 2024-09-06 16:06:10.619400726 +0300
@@ -1,7 +1,7 @@
-000000 00 00 00 00 00 00 00 3e 00 00 00 3d 00 00 00 3f
-000010 00 00 00 00 04 d7 68 0e 45 bf 00 00 00 00 00 00
-000020 00 00 00 00 00 48 00 25 08 09 80 97 00 00 00 00
-000030 08 01 00 02 00 01 00 95 00 00 00 00 00 00 02 b9
+000000 98 bf a7 56 00 00 00 3e 00 00 00 3d 00 00 00 3f
+000010 00 00 00 00 04 86 8d 0b 45 bf 00 00 00 00 00 00
+000020 00 00 00 00 00 48 00 25 07 fc 80 96 00 00 00 00
+000030 07 f4 00 05 00 00 00 94 00 00 00 00 00 00 02 aa
000040 00 00 00 00 00 00 00 00 00 8a 00 00 00 00 00 00
000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00
000060 02 00 1a 69 6e 66 69 6d 75 6d 00 08 00 0b 00 00
@@ -95,7 +95,7 @@
0005e0 00 00 00 00 00 fa a5 04 03 68 02 08 00 00 00 00
0005f0 00 00 fa a6 00 03 70 00 0d 00 00 00 01 00 00 00
000600 17 00 03 78 00 0d 00 00 00 01 00 00 00 22 00 03
-000610 80 00 0d 00 00 00 01 00 00 00 26 06 03 88 00 0d
+000610 80 00 0d 00 00 00 01 00 00 00 26 05 03 88 00 0d
000620 00 00 00 01 00 00 00 43 00 03 90 00 0d 00 00 00
000630 01 00 00 00 61 00 03 98 00 0d 00 00 00 01 00 00
000640 00 77 00 03 a0 00 0d 00 00 00 01 00 00 00 dd 04
@@ -125,9 +125,8 @@
0007c0 00 00 00 02 00 00 00 69 00 04 90 00 0d 00 00 00
0007d0 02 00 00 00 6a 00 04 98 00 0d 00 00 00 02 00 00
0007e0 00 9f 00 04 a0 f8 89 00 00 00 02 00 00 00 b4 00
-0007f0 04 a8 00 0d 00 00 00 00 00 00 fa a7 00 04 b0 fd
-000800 f8 00 00 00 00 00 00 fa a8 00 00 00 00 00 00 00
-000810 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+0007f0 04 a8 fe 05 00 00 00 00 00 00 fa a7 00 00 00 00
+000800 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*
000fa0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 70
000fb0 07 8c 07 58 07 24 06 f0 06 bc 06 88 06 54 06 20
diff -u <(od -Ax -t x1 /dev/shm/goodz-3e.bin) <(od -Ax -t x1 /dev/shm/badz-3e.bin)
--- /dev/fd/63 2024-09-06 16:07:02.001211689 +0300
+++ /dev/fd/62 2024-09-06 16:07:01.997211548 +0300
@@ -1,7 +1,7 @@
-000000 64 b6 ff ff 00 00 00 3e 00 00 00 3d 00 00 00 3f
-000010 00 00 00 00 04 d7 68 0e 45 bf 00 00 00 00 00 00
-000020 00 00 00 00 00 48 00 25 08 09 80 97 00 00 00 00
-000030 08 01 00 02 00 01 00 95 00 00 00 00 00 00 02 b9
+000000 98 bf a7 56 00 00 00 3e 00 00 00 3d 00 00 00 3f
+000010 00 00 00 00 04 86 8d 0b 45 bf 00 00 00 00 00 00
+000020 00 00 00 00 00 48 00 25 07 fc 80 96 00 00 00 00
+000030 07 f4 00 05 00 00 00 94 00 00 00 00 00 00 02 aa
000040 00 00 00 00 00 00 00 00 00 8a 00 00 00 00 00 00
000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 48 0d
000060 12 64 00 00 00 00 ff ff 2d d2 4b 4b d4 51 18 07
@@ -25,8 +25,7 @@
000180 38 57 c8 fb 91 39 39 2c e4 61 96 f1 3e a7 f9 22
000190 32 91 cf 02 16 b3 89 97 78 97 6b fc 9e 35 f4 2c
0001a0 65 07 2f 30 fc e7 30 bf f8 0f 94 58 55 d6 81 28
-0001b0 00 00 00 00 00 00 fa a7 81 2a 00 00 00 00 00 00
-0001c0 fa a8 00 00 00 00 00 00 00 00 00 00 00 00 00 00
-0001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+0001b0 00 00 00 00 00 00 fa a7 00 00 00 00 00 00 00 00
+0001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*
I must focus on the recovery of this page 0x3e in the tablespace 0x48. The correct FIL_PAGE_LSN would be 0x04d7680e while we only got the changes up to 0x04868d0b.