質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.31%

Q&A

解決済

1回答

763閲覧

mariaDBでの「log sequence number is in the future」のエラーについて

of_the_Europa

総合スコア66

0グッド

0クリップ

投稿2023/10/24 12:13

一週間ほど前からxamppのmysqlで「log sequence number is in the future」のエラーが頻発しております。一時はmysqlが起動できない状態でしたが、現在は新しいxamppに入れ直してmysqlは何とか起動しています。
しかし、mysql_error.logを見ると相変わらず「log sequence number is in the future」のエラーが存在します。このままではまた、数日するとmysqlが起動しなくなるかもしれないので、何とか解決すべく質問させていただきました。

これは現在のエラー内容になります。↓↓↓

2023-10-24 17:31:05 0 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions 2023-10-24 17:31:05 0 [Note] InnoDB: Uses event mutexes 2023-10-24 17:31:05 0 [Note] InnoDB: Compressed tables use zlib 1.2.12 2023-10-24 17:31:05 0 [Note] InnoDB: Number of pools: 1 2023-10-24 17:31:05 0 [Note] InnoDB: Using SSE2 crc32 instructions 2023-10-24 17:31:05 0 [Note] InnoDB: Initializing buffer pool, total size = 16M, instances = 1, chunk size = 16M 2023-10-24 17:31:05 0 [Note] InnoDB: Completed initialization of buffer pool 2023-10-24 17:31:05 0 [Note] InnoDB: Starting crash recovery from checkpoint LSN=109758264 2023-10-24 17:31:05 0 [ERROR] InnoDB: Page [page id: space=0, page number=302] log sequence number 539820803 is in the future! Current system log sequence number 109758282. 2023-10-24 17:31:05 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 https://mariadb.com/kb/en/library/innodb-recovery-modes/ for information about forcing recovery. 2023-10-24 17:31:05 0 [ERROR] InnoDB: Page [page id: space=0, page number=303] log sequence number 539820779 is in the future! Current system log sequence number 109758282. 2023-10-24 17:31:05 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 https://mariadb.com/kb/en/library/innodb-recovery-modes/ for information about forcing recovery. 2023-10-24 17:31:05 0 [ERROR] InnoDB: Page [page id: space=0, page number=304] log sequence number 539820791 is in the future! Current system log sequence number 109758282. 2023-10-24 17:31:05 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 https://mariadb.com/kb/en/library/innodb-recovery-modes/ for information about forcing recovery. 2023-10-24 17:31:06 0 [Note] InnoDB: 128 out of 128 rollback segments are active. 2023-10-24 17:31:06 0 [ERROR] InnoDB: Page [page id: space=0, page number=305] log sequence number 539820815 is in the future! Current system log sequence number 109758282. 2023-10-24 17:31:06 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 https://mariadb.com/kb/en/library/innodb-recovery-modes/ for information about forcing recovery. 2023-10-24 17:31:06 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1" 2023-10-24 17:31:06 0 [Note] InnoDB: Creating shared tablespace for temporary tables 2023-10-24 17:31:06 0 [Note] InnoDB: Setting file 'C:\xampp\mysql\data\ibtmp1' size to 12 MB. Physically writing the file full; Please wait ... 2023-10-24 17:31:06 0 [Note] InnoDB: File 'C:\xampp\mysql\data\ibtmp1' size is now 12 MB. 2023-10-24 17:31:06 0 [Note] InnoDB: Waiting for purge to start 2023-10-24 17:31:06 0 [Note] InnoDB: 10.4.27 started; log sequence number 109758273; transaction id 529107 2023-10-24 17:31:06 0 [Note] InnoDB: Loading buffer pool(s) from C:\xampp\mysql\data\ib_buffer_pool 2023-10-24 17:31:06 0 [Note] Plugin 'FEEDBACK' is disabled. 2023-10-24 17:31:06 0 [Note] Server socket created on IP: '::'.

不必要かもしれませんが、エラー内容の前後も一緒に張り付けてあります。
[ERROR]部分の、page number=303、page number=304、page number=305がどこを示しているかは正直分からないです。

show engine innodb status で確認したところ、lsnの数値はこのようになっております。

--- LOG --- Log sequence number 109758291 Log flushed up to 109758291 Pages flushed up to 109758291 Last checkpoint at 109758282

正直、Current system log sequence number と Last checkpoint at の数値が一致するくらいで、それ以外でこれが正常かどうかはよく分かりませんでした。

試してみたこととしては、下記ページで紹介されていた「データをインサートしまくってLSNの値を進める」という方法です。下記ページの「うまく行った方法」という箇所に記されています。
log sequence number is in the future

これをxamppの再インストール直後に実施しましたが、たぶんうまく行っていないと思います。この成功例としてはおそらく Log sequence number と Last checkpoint at の数値を大きく乖離させることが狙いなのかと思われますが、その差は特に変化がありませんでした。因みに、この方法が一時的な手段であることは何となく理解しております。

また、xamppを再インストールした際にはwordpressとその他開発に必要なデータベースだけをいれて、標準のフォルダやファイル群はibdata1だけ入れるようにしました。しかしそれ以後も「log sequence number is in the future」のエラーは存在します。

私が使用するローカル環境は以下になります。

windows10 XAMPP for Windows 8.1.12 mysql Ver 15.1 Distrib 10.4.27-MariaDB, for Win64 (AMD64) VScode 1.83.1 ※xamppで開発中のcmsやフレームワーク wordpress 5.9.8(マルチサイト) Laravel Framework 9.52.15

知識としては素人同然ですので、できるだけ分かり易く教えていただけたら幸いです。
何卒よろしくお願いします。

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

自己解決

根本的な解決とは行きませんが、とりあえずエラーが解消されましたので自己解決ということにさせていただきます。

私の間違った認識でて手こずっていたようです。
データをインサートしまくってLSNの値を進めるときに、確認すべき値は Log sequence number そのものと、現在のログ番号である Current system log sequence number のことでした。はい、エラーに記載がある通りです(汗)これを自分の中では Log sequence number と 最後に実行されたチェックポイントである Last checkpoint at との差異のことだと誤解していました。
なのでそれ以降は最新のエラー表記にある値を確認しながら Current system log sequence number が log sequence number より大きくなるまで、足りなかった分をひたすらインサートしまくってエラー解消させました。見方が間違っていたために前回のインサートではまだ不足していたようです。

投稿2023/10/24 19:04

of_the_Europa

総合スコア66

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.31%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問