Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
10.5, 10.6, 10.7(EOL), 10.8(EOL), 10.9(EOL), 10.10(EOL), 10.11, 11.0(EOL)
Description
origin/10.7 d1a4f6e627b3ad2c86946da08b8e82909707da7c 2023-01-17T11:41:29+02:00
|
rr
|
origin/bb-10.6-MDEV-30400 de4030e4d49805a7ded5c0bfee01cc3fd7623522 2023-01-24T14:09:21+02:00
|
Scenario:
|
1. Start the DB server and generate some initial data
|
2. Several sessions run a DML mix
|
3. During 2. is ongoing SIGKILL the DB server and try to restart
|
The restart fails with
|
# 2023-01-26T12:43:46 [195747] | [rr 260971 8174]2023-01-26 12:42:58 0 [ERROR] InnoDB: OPT_PAGE_CHECKSUM mismatch on [page id: space=2, page number=577]
|
# 2023-01-26T12:43:46 [195747] | [rr 260971 8178]2023-01-26 12:42:58 0 [ERROR] InnoDB: Set innodb_force_recovery=1 to ignore corruption.
|
# 2023-01-26T12:43:46 [195747] | [rr 260971 8269]2023-01-26 12:42:58 0 [ERROR] InnoDB: Unable to apply log to corrupted page [page id: space=2, page number=577]; set innodb_force_recovery to ignore
|
# 2023-01-26T12:43:46 [195747] | [rr 260971 8273]2023-01-26 12:42:58 0 [ERROR] InnoDB: Failed to read page 577 from file './/undo002': Page read from tablespace is corrupted.
|
# 2023-01-26T12:43:46 [195747] | [rr 260971 17093]2023-01-26 12:43:00 0 [ERROR] InnoDB: Plugin initialization aborted at srv0start.cc[1496] with error Data structure corruption
|
# 2023-01-26T12:43:46 [195747] | [rr 260971 17097]2023-01-26 12:43:00 0 [Note] InnoDB: Starting shutdown...
|
# 2023-01-26T12:43:46 [195747] | [rr 260971 17665]2023-01-26 12:43:01 0 [ERROR] Plugin 'InnoDB' init function returned error.
|
|
pluto:/data/results/1674736672/TBR-1646$ _RR_TRACE_DIR=./1/rr/ rr replay --mark-stdio
|
|
RQG
|
===
|
# git clone https://github.com/mleich1/rqg --branch <pick the right branch> RQG
|
#
|
# GIT_SHOW: HEAD -> master, origin/master, origin/HEAD 36f1d5c64870abcdbe123ec98869f7045533d458 2023-01-23T16:20:15+01:00
|
# rqg.pl : Version 4.2.1 (2022-12)
|
#
|
# $RQG_HOME/rqg.pl \
|
# --grammar=conf/engines/many_indexes.yy \
|
# --gendata=conf/engines/many_indexes.zz \
|
# --reporters=CrashRecovery \
|
# --mysqld=--loose-innodb_lock_schedule_algorithm=fcfs \
|
# --mysqld=--loose-idle_write_transaction_timeout=0 \
|
# --mysqld=--loose-idle_transaction_timeout=0 \
|
# --mysqld=--loose-idle_readonly_transaction_timeout=0 \
|
# --mysqld=--connect_timeout=60 \
|
# --mysqld=--interactive_timeout=28800 \
|
# --mysqld=--slave_net_timeout=60 \
|
# --mysqld=--net_read_timeout=30 \
|
# --mysqld=--net_write_timeout=60 \
|
# --mysqld=--loose-table_lock_wait_timeout=50 \
|
# --mysqld=--wait_timeout=28800 \
|
# --mysqld=--lock-wait-timeout=86400 \
|
# --mysqld=--innodb-lock-wait-timeout=50 \
|
# --no-mask \
|
# --queries=10000000 \
|
# --seed=random \
|
# --reporters=Backtrace \
|
# --reporters=ErrorLog \
|
# --reporters=Deadlock \
|
# --validators=None \
|
# --mysqld=--log_output=none \
|
# --mysqld=--log_bin_trust_function_creators=1 \
|
# --mysqld=--loose-debug_assert_on_not_freed_memory=0 \
|
# --engine=InnoDB \
|
# --restart_timeout=240 \
|
# --mysqld=--plugin-load-add=file_key_management.so \
|
# --mysqld=--loose-file-key-management-filename=$RQG_HOME/conf/mariadb/encryption_keys.txt \
|
# --mysqld=--plugin-load-add=provider_lzo.so \
|
# --mysqld=--plugin-load-add=provider_bzip2.so \
|
# --mysqld=--plugin-load-add=provider_lzma.so \
|
# --mysqld=--plugin-load-add=provider_snappy.so \
|
# --mysqld=--plugin-load-add=provider_lz4.so \
|
# --duration=300 \
|
# --mysqld=--loose-innodb_fatal_semaphore_wait_threshold=300 \
|
# --mysqld=--innodb_file_per_table=1 \
|
# --mysqld=--loose-innodb_read_only_compressed=OFF \
|
# --mysqld=--innodb_stats_persistent=off \
|
# --mysqld=--innodb_adaptive_hash_index=off \
|
# --mysqld=--innodb_sort_buffer_size=65536 \
|
# --redefine=conf/mariadb/redefine_checks_off.yy \
|
# --mysqld=--loose-innodb_evict_tables_on_commit_debug=off \
|
# --mysqld=--loose-max-statement-time=30 \
|
# --threads=2 \
|
# --mysqld=--innodb-use-native-aio=0 \
|
# --mysqld=--loose-gdb \
|
# --mysqld=--loose-debug-gdb \
|
# --rr=Extended \
|
# --rr_options=--wait \
|
# --mysqld=--innodb_undo_tablespaces=3 \
|
# --mysqld=--innodb_undo_log_truncate=ON \
|
# --mysqld=--loose_innodb_change_buffering=all \
|
# --mysqld=--innodb_rollback_on_timeout=OFF \
|
# --mysqld=--innodb_page_size=4K \
|
# --mysqld=--innodb-buffer-pool-size=256M \
|
# <local settings>
|
I had 3 replays of the problem per ~ 280 runs of the test.
|
Attachments
Issue Links
- causes
-
MDEV-30657 [ERROR] InnoDB: Not applying UNDO_APPEND due to corruption during Recovery
-
- Closed
-
-
MDEV-31487 Recovery or backup failure after innodb_undo_log_truncate=ON
-
- Closed
-
- relates to
-
MDEV-29986 Set innodb_undo_tablespaces=3 by default
-
- Closed
-
The page in question was written here:
ssh pluto
rr replay /data/results/1674736672/TBR-1646/1/rr/mysqld-1
run 1928000
watch -l log_sys.lsn._M_i
reverse-continue
backtrace
…
Thread 1 hit Hardware watchpoint 1: -location log_sys.lsn._M_i
Old value = 93515647
New value = 93515562
0x0000563239a5a349 in std::__atomic_base<unsigned long>::store (
__m=std::memory_order_release, __i=93515647, this=<optimized out>)
at /usr/include/c++/9/bits/atomic_base.h:390
390 store(__int_type __i, memory_order __m = memory_order_seq_cst) noexcept
…
#5 0x0000563239a4cb77 in mtr_t::commit (this=this@entry=0x7fbb382d6cb0)
at /data/Server/bb-10.6-MDEV-30400C/storage/innobase/mtr/mtr0mtr.cc:148
#6 0x0000563239d04be4 in trx_purge_free_segment (
rseg=rseg@entry=0x56323b7c12c0 <trx_sys+28544>, hdr_addr=...)
at /data/Server/bb-10.6-MDEV-30400C/storage/innobase/trx/trx0purge.cc:469
#7 0x0000563239d062a7 in trx_purge_truncate_rseg_history (rseg=..., limit=...)
at /data/Server/bb-10.6-MDEV-30400C/storage/innobase/trx/trx0purge.cc:549
#8 0x0000563239d10371 in trx_purge_truncate_history ()
at /data/Server/bb-10.6-MDEV-30400C/storage/innobase/trx/trx0purge.cc:643
#9 0x0000563239d16812 in trx_purge (n_tasks=<optimized out>,
…
At this point of execution, we can access the block here:
frame 4
set $block=(buf_block_t*)m_memo.small[5].object
Between this and the recovery, the page contents differs quite a bit:
--- /dev/fd/63 2023-01-27 10:22:59.045904382 +0200
+++ /dev/fd/62 2023-01-27 10:22:59.025903573 +0200
@@ -1,6 +1,6 @@
000000 00 00 00 00 00 00 02 41 ff ff ff ff ff ff ff ff
-000010 00 00 00 00 05 92 ef 2a 00 03 00 00 00 00 00 00
-000020 00 00 00 00 00 02 ff ff ff ff 00 00 00 00 01 8e
+000010 00 00 00 00 03 82 bf 89 00 03 00 00 00 00 00 00
+000020 00 00 00 00 00 02 00 00 02 16 00 26 00 00 01 af
000030 00 26 00 00 00 00 00 00 00 d6 00 00 00 00 00 00
000040 00 00 ff ff ff ff 00 00 ff ff ff ff 00 00 00 00
*
@@ -11,7 +11,14 @@
000270 ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00
000280 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*
-0006f0 00 00 00 00 00 00 00 00 00 d7 00 00 00 00 00 00
+0004b0 00 00 00 00 00 00 00 00 00 a4 00 00 00 00 00 00
+0004c0 00 00 ff ff ff ff 00 00 ff ff ff ff 00 00 00 00
+*
+0004e0 00 00 ff ff ff ff 00 00 ff ff ff ff 00 00 05 d6
+0004f0 69 d2 00 00 02 47 ff ff ff ff ff ff ff ff ff ff
+000500 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
+*
+0006f0 ff ff 00 00 00 00 00 00 00 d7 00 00 00 00 00 00
000700 00 00 ff ff ff ff 00 00 ff ff ff ff 00 00 00 00
*
000720 00 00 ff ff ff ff 00 00 ff ff ff ff 00 00 05 d6
@@ -21,5 +28,12 @@
000930 ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00
000940 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*
-000ff0 00 00 00 00 00 00 00 00 03 82 bf 89 89 d0 04 6b
+000db0 00 00 00 00 00 00 00 00 00 d8 00 00 00 00 00 00
+000dc0 00 00 ff ff ff ff 00 00 ff ff ff ff 00 00 00 00
+*
+000de0 00 00 ff ff ff ff 00 00 ff ff ff ff 00 00 05 d6
+000df0 69 d2 00 00 00 f9 ff ff ff ff ff ff ff ff ff ff
+000e00 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
+*
+000ff0 ff ff 00 00 00 00 00 00 03 82 bf 89 89 d0 04 6b
The mini-transaction generated the following 85 bytes of log:
(rr) p/x *m_log.m_first_block.m_data@m_log.m_size
$6 = {0x39, 0x2, 0x25, 0x32, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0xb7, 0x0,
0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x34, 0x2, 0x25, 0x31, 0x0, 0x34, 0x2,
0x25, 0x2d, 0x0, 0x47, 0x2, 0x81, 0xc1, 0x82, 0x32, 0x4, 0xff, 0x34, 0x2,
0x0, 0x3d, 0x5b, 0x2, 0x2, 0x37, 0x35, 0x2, 0x0, 0x80, 0x3b, 0xea, 0x48,
0x2, 0x81, 0xc1, 0x81, 0xf2, 0x81, 0xc0, 0x0, 0x77, 0x2, 0x25, 0x0, 0x67,
0x57, 0x32, 0xe1, 0x78, 0x2, 0x81, 0xc1, 0x0, 0x19, 0xee, 0x8b, 0x3c, 0x77,
0x2, 0x0, 0x0, 0x67, 0x32, 0x82, 0x1f, 0x0}
Let us filter out the records for this page 2:0x241:
0x47, 0x2, 0x81, 0xc1, 0x82, 0x32, 0x4, 0xff, MEMSET, writing 4×0xff bytes at offset 690
0x48, 0x2, 0x81, 0xc1, 0x81, 0xf2, 0x81, 0xc0, 0x0, MEMSET, writing 576×0x0 bytes at offset 626
0x78, 0x2, 0x81, 0xc1, 0x0, 0x19, 0xee, 0x8b, 0x3c, PAGE_CHECKSUM 0x19ee8b3c (this trips the recovery failure)
At the start of the mini-transaction (and before applying any redo log to it on recovery), the page contents differs quite a bit as well:
--- /dev/fd/63 2023-01-27 10:48:35.250176986 +0200
+++ /dev/fd/62 2023-01-27 10:48:35.250176986 +0200
@@ -1,6 +1,6 @@
000000 00 00 00 00 00 00 02 41 ff ff ff ff ff ff ff ff
-000010 00 00 00 00 05 92 ee fa 00 03 00 00 00 00 00 00
-000020 00 00 00 00 00 02 ff ff ff ff 00 00 00 00 01 8e
+000010 00 00 00 00 03 82 bf 89 00 03 00 00 00 00 00 00
+000020 00 00 00 00 00 02 00 00 02 16 00 26 00 00 01 af
000030 00 26 00 00 00 00 00 00 00 d6 00 00 00 00 00 00
000040 00 00 ff ff ff ff 00 00 ff ff ff ff 00 00 00 00
*
@@ -8,17 +8,17 @@
000070 69 d2 00 00 00 f7 ff ff ff ff ff ff ff ff ff ff
000080 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
*
-000270 ff ff 00 00 00 00 00 00 00 e7 00 00 00 00 00 00
-000280 00 00 ff ff ff ff 00 00 ff ff ff ff 00 00 00 00
+000270 ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+000280 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*
-0002a0 00 00 ff ff ff ff 00 00 ff ff ff ff 00 00 05 d6
-0002b0 69 d2 00 00 00 37 00 00 00 38 ff ff ff ff ff ff
-0002c0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
+0004b0 00 00 00 00 00 00 00 00 00 a4 00 00 00 00 00 00
+0004c0 00 00 ff ff ff ff 00 00 ff ff ff ff 00 00 00 00
*
-0004b0 ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00
-0004c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+0004e0 00 00 ff ff ff ff 00 00 ff ff ff ff 00 00 05 d6
+0004f0 69 d2 00 00 02 47 ff ff ff ff ff ff ff ff ff ff
+000500 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
*
-0006f0 00 00 00 00 00 00 00 00 00 d7 00 00 00 00 00 00
+0006f0 ff ff 00 00 00 00 00 00 00 d7 00 00 00 00 00 00
000700 00 00 ff ff ff ff 00 00 ff ff ff ff 00 00 00 00
*
000720 00 00 ff ff ff ff 00 00 ff ff ff ff 00 00 05 d6
@@ -28,5 +28,12 @@
000930 ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00
000940 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*
-000ff0 00 00 00 00 00 00 00 00 03 82 bf 89 89 d0 04 6b
+000db0 00 00 00 00 00 00 00 00 00 d8 00 00 00 00 00 00
+000dc0 00 00 ff ff ff ff 00 00 ff ff ff ff 00 00 00 00
+*
+000de0 00 00 ff ff ff ff 00 00 ff ff ff ff 00 00 05 d6
+000df0 69 d2 00 00 00 f9 ff ff ff ff ff ff ff ff ff ff
+000e00 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
+*
+000ff0 ff ff 00 00 00 00 00 00 03 82 bf 89 89 d0 04 6b
So, we will have to track earlier changes to the page, to find where some change was not logged.