Bug #105817 InnoDB: Corruption of an index tree when I insert into table using pt-archiver
Submitted: 7 Dec 2021 8:39 Modified: 7 Dec 2021 13:19
Reporter: Peter Jin Email Updates:
Status: Unsupported Impact on me:
Category:MySQL Server Severity:S2 (Serious)
Version:5.7.24 OS:CentOS (CentOS Linux release 7.2.1511 (Core))
Assigned to: CPU Architecture:x86 (Intel(R) Xeon(R) Silver 4208 CPU @ 2.10GHz)
Tags: corruption, INDEX

[7 Dec 2021 8:39] Peter Jin
When I used pt-archiver to insert into a table, DB crashed and could not restart.I tried setting innodb_force_recovery=6 but still not work. 
Finally I moved the crashed table data files to other directory and then I can start db.
Why it happened? If it's due to pt-archiver, but I use it for several years and this is the first time error.

The pt-archiver command:
pt-archiver --source h=a,u=ygadmin,p='xxx',D=xxx,t=${ARC_TABLE},A=utf8 --dest h=b,u=ygadmin,p='xxx',D=xxx,t=${ARC_TABLE},A=utf8 --no-delete --charset=utf8 --limit=10000 --txn-size 10000 --progress 10000 --statistics --no-check-columns --ignore --no-check-charset --max-lag 100 --where "archive_time > '2021-11-24'" > log/${ARC_TABLE}_`date +%F`.log

The error message in log:
2021-12-06T13:43:38.198642+08:00 2082387 [ERROR] InnoDB: Corruption of an index tree: table `yg_history_2021`.`express_order_202110` index `idx_archive_time`, father ptr page no 1101157, child page no 1101158
PHYSICAL RECORD: n_fields 2; compact format; info bits 0
 0: len 5; hex 99ab32049c; asc   2  ;;
 1: len 8; hex 14247fdaa9421000; asc  $   B  ;;
PHYSICAL RECORD: n_fields 3; compact format; info bits 0
 0: len 5; hex 99ab320494; asc   2  ;;
 1: len 8; hex 142473d9aa8c5000; asc  $s   P ;;
 2: len 4; hex 0010cd65; asc    e;;
2021-12-06T13:43:38.307860+08:00 2082387 [ERROR] [FATAL] InnoDB: You should dump + drop + reimport the table to fix the corruption. If the crash happens at database startup. Please refer to http://dev.mysql.com/doc/refman/5.7/en/forcing-innodb-recovery.html for information about forcing recovery. Then dump + drop + reimport.
2021-12-06 13:43:38 0x7f66f1a7b700  InnoDB: Assertion failure in thread 140080117692160 in file ut0ut.cc line 942
InnoDB: We intentionally generate a memory trap.
InnoDB: Submit a detailed bug report to http://bugs.mysql.com.
InnoDB: If you get repeated assertion failures or crashes, even
InnoDB: immediately after the mysqld startup, there may be
InnoDB: corruption in the InnoDB tablespace. Please refer to
InnoDB: http://dev.mysql.com/doc/refman/5.7/en/forcing-innodb-recovery.html
InnoDB: about forcing recovery.
05:43:38 UTC - mysqld got signal 6 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
Attempting to collect some information that could help diagnose the problem.
As this is a crash and something is definitely wrong, the information
collection process might fail.

It is possible that mysqld could use up to 
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 163915067 K  bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

Thread pointer: 0x7f6698847960
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 7f66f1a7ae80 thread_stack 0x12c0000

Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (7f66986d8cd0): is an invalid pointer
Connection ID (thread ID): 2082387

The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.

How to repeat:
I didn't try cause I must recover db and check the data first.
[7 Dec 2021 13:19] MySQL Verification Team
Hi Mr. Jin,

Thank you for your bug report.

However, we can not proceed in processing your report any further.

First of all, we accept here bug reports for MySQL@Oracle products only, not for any other tools available for the community.

Also, 5.7.24 is an ancient release and there are so many bugs fixed interim that one and our latest release. We urge you to try our tools and our latest  5.7 or 8.0 release.