1.5T MySQL数据库美满规复---惜分飞

[复制链接]
发表于 昨天 21:53 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

×
有客户MySQL数据库非常无法正常启动,必要提供规复支持,当时提供的错误日记信息为:log sequence number xxxx is in the future

2026-06-03T13:35:02.368514Z 0 [ERROR] InnoDB: Your database may be corrupt or you may have copied the InnoDB tablespace but not the InnoDB log files. Please refer to http://dev.mysql.com/doc/refman/5.7/en/forcing-innodb-recovery.html for information about forcing recovery.
2026-06-03T13:35:02.369669Z 0 [ERROR] InnoDB: Page [page id: space=0, page number=521127] log sequence number 15319315659882 is in the future! Current system log sequence number 6712970192343.
重新分析mysql的日记,发现最初环境为: 
---TRANSACTION 8424429306, ACTIVE 259 sec truncating tablemysql tables in use 1, locked 10 lock struct(s), heap size 1136, 0 row lock(s)MySQL thread id 4513911, OS thread handle 21996, query id 4194188849 localhost 127.0.0.1 root System lockTRUNCATE TABLE xxxx--------FILE I/O--------I/O thread 0 state: wait Windows aio (insert buffer thread)I/O thread 1 state: wait Windows aio (log thread)I/O thread 2 state: complete io for buf page (read thread)I/O thread 3 state: wait Windows aio (read thread)I/O thread 4 state: wait Windows aio (read thread)I/O thread 5 state: complete io for buf page (read thread)I/O thread 6 state: wait Windows aio (write thread)I/O thread 7 state: wait Windows aio (write thread)I/O thread 8 state: wait Windows aio (write thread)I/O thread 9 state: wait Windows aio (write thread)Pending normal aio reads: [2, 0, 0, 3] , aio writes: [0, 0, 0, 0] , ibuf aio reads:, log i/o's:, sync i/o'sending flushes (fsync) log: 0; buffer pool: 0908141629 OS file reads, 8774070813 OS file writes, 2977363738 OS fsyncs0.00 reads/s, 0 avg bytes/read, 0.00 writes/s, 0.00 fsyncs/s-------------------------------------INSERT BUFFER AND ADAPTIVE HASH INDEX-------------------------------------InnoDB: ###### Diagnostic info printed to the standard error stream2026-06-03T06:37:25.679003Z 0 [Warning] InnoDB: A long semaphore wait:--Thread 17216 has waited at btr0sea.ic line 128 for 258  seconds the semaphore:S-lock on RW-latch at 0000017F19122E18 created in file btr0sea.cc line 195a writer (thread id 8340) has reserved it in mode  wait exclusivenumber of readers 1, waiters flag 1, lock_word: ffffffffLast time read locked in file btr0sea.ic line 128Last time write locked in file g:\ade\build\sb_0-34537258-1560180832.84\mysql-5.7.27\storage\innobase\include\btr0sea.ic line 902026-06-03T06:37:25.681739Z 0 [Warning] InnoDB: A long semaphore wait:--Thread 28160 has waited at btr0sea.ic line 128 for 241  seconds the semaphore:S-lock on RW-latch at 0000017F19123598 created in file btr0sea.cc line 195a writer (thread id 13620) has reserved it in mode  wait exclusivenumber of readers 1, waiters flag 1, lock_word: ffffffffLast time read locked in file btr0sea.ic line 128Last time write locked in file G:\ade\build\sb_0-34537258-1560180832.84\mysql-5.7.27\storage\innobase\btr\btr0cur.cc line 38742026-06-03T06:37:25.684495Z 0 [Warning] InnoDB: A long semaphore wait:--Thread 23052 has waited at btr0sea.ic line 128 for 253  seconds the semaphore:S-lock on RW-latch at 0000017F19123598 created in file btr0sea.cc line 195a writer (thread id 13620) has reserved it in mode  wait exclusivenumber of readers 1, waiters flag 1, lock_word: ffffffffLast time read locked in file btr0sea.ic line 128Last time write locked in file G:\ade\build\sb_0-34537258-1560180832.84\mysql-5.7.27\storage\innobase\btr\btr0cur.cc line 38742026-06-03T06:37:25.687586Z 0 [Warning] InnoDB: A long semaphore wait:--Thread 28480 has waited at btr0sea.ic line 128 for 272  seconds the semaphore:S-lock on RW-latch at 0000017F19122E18 created in file btr0sea.cc line 195a writer (thread id 8340) has reserved it in mode  wait exclusivenumber of readers 1, waiters flag 1, lock_word: ffffffffLast time read locked in file btr0sea.ic line 128Last time write locked in file g:\ade\build\sb_0-34537258-1560180832.84\mysql-5.7.27\storage\innobase\include\btr0sea.ic line 902026-06-03T06:37:25.689857Z 0 [Warning] InnoDB: A long semaphore wait:--Thread 2868 has waited at buf0flu.cc line 1209 for 262  seconds the semaphore:SX-lock on RW-latch at 00000179B38E0DC0 created in file buf0buf.cc line 1460a writer (thread id 1008) has reserved it in mode  exclusivenumber of readers 0, waiters flag 1, lock_word: f0000000Last time read locked in file ibuf0ibuf.cc line 4552Last time write locked in file G:\ade\build\sb_0-34537258-1560180832.84\mysql-5.7.27\storage\innobase\ibuf\ibuf0ibuf.cc line 406…………………………2026-06-03T06:37:56.919054Z 0 [Warning] InnoDB: A long semaphore wait:--Thread 13620 has waited at btr0sea.ic line 90 for 303  seconds the semaphore:X-lock (wait_ex) on RW-latch at 0000017F19123598 created in file btr0sea.cc line 195a writer (thread id 13620) has reserved it in mode  wait exclusivenumber of readers 1, waiters flag 1, lock_word: ffffffffLast time read locked in file btr0sea.ic line 128Last time write locked in file G:\ade\build\sb_0-34537258-1560180832.84\mysql-5.7.27\storage\innobase\btr\btr0cur.cc line 38742026-06-03T06:37:56.921090Z 0 [Warning] InnoDB: A long semaphore wait:--Thread 24268 has waited at btr0sea.ic line 128 for 252  seconds the semaphore:S-lock on RW-latch at 0000017F19122E18 created in file btr0sea.cc line 195a writer (thread id 8340) has reserved it in mode  wait exclusivenumber of readers 1, waiters flag 1, lock_word: ffffffffLast time read locked in file btr0sea.ic line 128Last time write locked in file g:\ade\build\sb_0-34537258-1560180832.84\mysql-5.7.27\storage\innobase\include\btr0sea.ic line 902026-06-03T06:37:56.923175Z 0 [Warning] InnoDB: A long semaphore wait:--Thread 15984 has waited at btr0sea.ic line 128 for 302  seconds the semaphore:S-lock on RW-latch at 0000017F19122CD8 created in file btr0sea.cc line 195a writer (thread id 5420) has reserved it in mode  wait exclusivenumber of readers 1, waiters flag 1, lock_word: ffffffffLast time read locked in file btr0sea.ic line 128Last time write locked in file G:\ade\build\sb_0-34537258-1560180832.84\mysql-5.7.27\storage\innobase\btr\btr0cur.cc line 3874InnoDB: ###### Starts InnoDB Monitor for 30 secs to print diagnostic info:InnoDB: Pending preads 0, pwrites 0InnoDB: ###### Diagnostic info printed to the standard error stream2026-06-03T07:04:50.616385Z 0 [Note] MySQL: Normal shutdown 2026-06-03T07:04:50.617251Z 0 [Note] Giving 97 client threads a chance to die gracefully2026-06-03T07:54:31.982035Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).2026-06-03T07:54:31.983047Z 0 [Warning] 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO'sql modes should be used with strict mode. They will be merged with strict mode in a future release.2026-06-03T07:54:31.983057Z 0 [Warning] 'NO_AUTO_CREATE_USER' sql mode was not set.2026-06-03T07:54:31.983098Z 0 [Note] --secure-file-priv is set to NULL. Operations related to importing and exporting data are disabled2026-06-03T07:54:31.985272Z 0 [Note] MySQL (mysqld 5.7.27) starting as process 832 ...2026-06-03T07:54:32.054771Z 0 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions2026-06-03T07:54:32.055435Z 0 [Note] InnoDB: Uses event mutexes2026-06-03T07:54:32.055728Z 0 [Note] InnoDB: _mm_lfence() and _mm_sfence() are used for memory barrier2026-06-03T07:54:32.056143Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.112026-06-03T07:54:32.057581Z 0 [Note] InnoDB: Number of pools: 12026-06-03T07:54:32.058963Z 0 [Note] InnoDB: Not using CPU crc32 instructions2026-06-03T07:54:32.063255Z 0 [Note] InnoDB: Initializing buffer pool, total size = 40G, instances = 8, chunk size = 128M2026-06-03T07:54:34.619212Z 0 [Note] InnoDB: Completed initialization of buffer pool2026-06-03T07:54:35.420695Z 0 [Note] InnoDB: Highest supported file format is Barracuda.2026-06-03T07:54:36.121477Z 0 [Note] InnoDB: Log scan progressed past the checkpoint lsn 153194385907912026-06-03T07:54:36.449855Z 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 153194438333442026-06-03T07:54:36.847204Z 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 153194490762242026-06-03T07:54:37.263455Z 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 153194543191042026-06-03T07:54:37.544475Z 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 153194595619842026-06-03T07:54:37.678504Z 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 153194630952462026-06-03T07:54:37.681262Z 0 [Note] InnoDB: Database was not shutdown normally!2026-06-03T07:54:37.681755Z 0 [Note] InnoDB: Starting crash recovery.2026-06-03T07:54:38.088953Z 0 [Note] InnoDB: 2 transaction(s) which must be rolled back or cleaned up in total 1 row operations to undo2026-06-03T07:54:38.089913Z 0 [Note] InnoDB: Trx id counter is 84244385282026-06-03T07:54:38.090288Z 0 [Note] InnoDB: Starting an apply batch of log records to the database...InnoDB: Progress in percent: 0 1 2 3 4 5 6 7 8 …… 91 92 93 94 95 96 97 98 99 2026-06-03T07:54:42.043861Z 0 [Note] InnoDB: Apply batch completed2026-06-03T07:54:42.295726Z 0 [Note] InnoDB: Rolling back trx with id 8424429306, 0 rows to undo2026-06-03T07:54:42.298212Z 0 [Note] InnoDB: Rollback of trx with id 8424429306 completed2026-06-03T07:55:19.432722Z 0 [Note] InnoDB: Completing truncate for table with id (8714) residing in file-per-table tablespace with id (6005)2026-06-03T07:55:30.963664Z 0 [ERROR] InnoDB: The age of the last checkpoint is 90593936, which exceeds the log group capacity 90593280.2026-06-03T07:55:47.442228Z 0 [ERROR] InnoDB: The age of the last checkpoint is 90602582, which exceeds the log group capacity 90593280.2026-06-03T07:56:05.422243Z 0 [ERROR] InnoDB: The age of the last checkpoint is 90609452, which exceeds the log group capacity 90593280.2026-06-03T07:56:27.643550Z 0 [ERROR] InnoDB: The age of the last checkpoint is 90621740, which exceeds the log group capacity 90593280.2026-06-03T07:56:47.845714Z 0 [ERROR] InnoDB: The age of the last checkpoint is 90627886, which exceeds the log group capacity 90593280.2026-06-03T07:57:04.714691Z 0 [ERROR] InnoDB: The age of the last checkpoint is 90639662, which exceeds the log group capacity 90593280.2026-06-03T07:57:26.028889Z 0 [ERROR] InnoDB: The age of the last checkpoint is 90645808, which exceeds the log group capacity 90593280.2026-06-03T07:57:42.796901Z 0 [ERROR] InnoDB: The age of the last checkpoint is 90655262, which exceeds the log group capacity 90593280.2026-06-03T07:58:04.513110Z 0 [ERROR] InnoDB: The age of the last checkpoint is 90670384, which exceeds the log group capacity 90593280.2026-06-03T07:58:20.675070Z 0 [ERROR] InnoDB: The age of the last checkpoint is 90689842, which exceeds the log group capacity 90593280.2026-06-03T07:58:39.362158Z 0 [ERROR] InnoDB: The age of the last checkpoint is 90699949, which exceeds the log group capacity 90593280.2026-06-03T07:58:57.146181Z 0 [ERROR] InnoDB: The age of the last checkpoint is 90707243, which exceeds the log group capacity 90593280.2026-06-03T07:59:15.226281Z 0 [ERROR] InnoDB: The age of the last checkpoint is 90731065, which exceeds the log group capacity 90593280.2026-06-03T07:59:32.902269Z 0 [ERROR] InnoDB: The age of the last checkpoint is 90751406, which exceeds the log group capacity 90593280.2026-06-03T07:59:55.020833Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).2026-06-03T07:59:55.022839Z 0 [Warning] 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO'sql modes should be used with strict mode. They will be merged with strict mode in a future release.2026-06-03T07:59:55.022856Z 0 [Warning] 'NO_AUTO_CREATE_USER' sql mode was not set.2026-06-03T07:59:55.022918Z 0 [Note] --secure-file-priv is set to NULL. Operations related to importing and exporting data are disabled2026-06-03T07:59:55.028372Z 0 [Note] MySQL (mysqld 5.7.27) starting as process 2532 ...2026-06-03T07:59:55.078201Z 0 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions2026-06-03T07:59:55.078998Z 0 [Note] InnoDB: Uses event mutexes2026-06-03T07:59:55.079491Z 0 [Note] InnoDB: _mm_lfence() and _mm_sfence() are used for memory barrier2026-06-03T07:59:55.080092Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.112026-06-03T07:59:55.084872Z 0 [Note] InnoDB: Number of pools: 12026-06-03T07:59:55.090793Z 0 [Note] InnoDB: Not using CPU crc32 instructions2026-06-03T07:59:55.096910Z 0 [Note] InnoDB: Initializing buffer pool, total size = 40G, instances = 8, chunk size = 128M2026-06-03T07:59:57.966267Z 0 [Note] InnoDB: Completed initialization of buffer pool2026-06-03T07:59:58.778551Z 0 [Note] InnoDB: Highest supported file format is Barracuda.2026-06-03T07:59:59.348188Z 0 [Note] InnoDB: Log scan progressed past the checkpoint lsn 153194478266572026-06-03T07:59:59.942491Z 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 153194530693122026-06-03T08:00:00.233703Z 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 153194583121922026-06-03T08:00:00.470153Z 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 153194635550722026-06-03T08:00:01.158338Z 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 153194687979522026-06-03T08:00:01.852263Z 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 153194740408322026-06-03T08:00:02.555075Z 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 153194792837122026-06-03T08:00:03.289043Z 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 153194845265922026-06-03T08:00:04.031381Z 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 153194897694722026-06-03T08:00:04.754714Z 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 153194950123522026-06-03T08:00:05.533650Z 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 153195002552322026-06-03T08:00:06.253542Z 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 153195054981122026-06-03T08:00:06.883691Z 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 153195107409922026-06-03T08:00:07.603988Z 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 153195159838722026-06-03T08:00:08.268531Z 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 153195212267522026-06-03T08:00:08.967662Z 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 153195264696322026-06-03T08:00:09.323566Z 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 153195291847272026-06-03T08:00:09.328240Z 0 [Note] InnoDB: Database was not shutdown normally!2026-06-03T08:00:09.328844Z 0 [Note] InnoDB: Starting crash recovery.2026-06-03T08:00:09.730171Z 0 [Note] InnoDB: 1 transaction(s) which must be rolled back or cleaned up in total 1 row operations to undo2026-06-03T08:00:09.731034Z 0 [Note] InnoDB: Trx id counter is 84244390402026-06-03T08:00:09.731402Z 0 [Note] InnoDB: Starting an apply batch of log records to the database...InnoDB: Progress in percent: 0 1 2 3 4 5 6 7 8 9 10 11 12 …… 94 95 96 97 98 99 2026-06-03T08:00:17.587182Z 0 [Note] InnoDB: Apply batch completed2026-06-03T08:01:02.988241Z 0 [Note] InnoDB: Completing truncate for table with id (8714) residing in file-per-table tablespace with id (6005)2026-06-03T08:01:07.965314Z 0 [ERROR] InnoDB: The age of the last checkpoint is 90593580, which exceeds the log group capacity 90593280.2026-06-03T08:01:25.945332Z 0 [ERROR] InnoDB: The age of the last checkpoint is 90599727, which exceeds the log group capacity 90593280.2026-06-03T08:01:43.117294Z 0 [ERROR] InnoDB: The age of the last checkpoint is 90610481, which exceeds the log group capacity 90593280.2026-06-03T08:02:05.338558Z 0 [ERROR] InnoDB: The age of the last checkpoint is 90622769, which exceeds the log group capacity 90593280.
从这里看,最初是truncate table xxxx,然后由于被壅闭了无法truncate乐成,可以就关闭了mysql服务,然后启动库就没有乐成,然后就是加上了innodb_force_recovery出现了上述截图的错误.实验举行欺压拉库,遭遇以下错误
[table][tr][td]2026-06-04T07:05:59.924315Z 0 [Note] MySQL (mysqld 5.7.27) starting as process 8764 ...2026-06-04T07:05:59.944187Z 0 [Warning] option 'innodb-purge-threads': unsigned value 0 adjusted to 12026-06-04T07:05:59.947611Z 0 [Note] InnoDB: Started in read only mode2026-06-04T07:05:59.948012Z 0 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions2026-06-04T07:05:59.948485Z 0 [Note] InnoDB: Uses event mutexes2026-06-04T07:05:59.948825Z 0 [Note] InnoDB: _mm_lfence() and _mm_sfence() are used for memory barrier2026-06-04T07:05:59.949329Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.112026-06-04T07:05:59.950087Z 0 [Note] InnoDB: Number of pools: 12026-06-04T07:05:59.950587Z 0 [Note] InnoDB: Not using CPU crc32 instructions2026-06-04T07:05:59.950987Z 0 [Note] InnoDB: Disabling background log and ibuf IO write threads.2026-06-04T07:05:59.952835Z 0 [Note] InnoDB: Initializing buffer pool, total size = 512M, instances = 1, chunk size = 128M2026-06-04T07:05:59.980631Z 0 [Note] InnoDB: Completed initialization of buffer pool2026-06-04T07:06:00.012856Z 0 [Note] InnoDB: Highest supported file format is Barracuda.2026-06-04T07:06:00.013649Z 0 [Note] InnoDB: The user has set SRV_FORCE_NO_LOG_REDO on, skipping log redo2026-06-04T07:06:00.019299Z 0 [Note] InnoDB: Completing truncate for table with id (8714) residing in file-per-table tablespace with id (6005)07:06:00 UTC - mysqld got exception 0xc0000005 ;This could be because you hit a bug. It is also possible that this binaryor 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 informationcollection process might fail. key_buffer_size=8388608read_buffer_size=131072max_used_connections=0max_threads=200thread_count=0connection_count=0It is possible that mysqld could use up to key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 87429 K  bytes of memoryHope that's ok; if not, decrease some variables in the equation. Thread pointer: 0x0Attempting backtrace. You can use the following information to find outwhere mysqld died. If you see no messages after this, something wentterribly wrong...7ff67eaba97e    mysqld.exe!std:perator
回复

使用道具 举报

登录后关闭弹窗

登录参与点评抽奖  加入IT实名职场社区
去登录
快速回复 返回顶部 返回列表