Database restore loses data when a row is larger than max_allowed_packet
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 25/100
調査の方向性
The issue identifies the database dump and import code but names no files or tests. Start by tracing where dump rows are batched and where restore statements are executed, then inspect the open pull request for the proposed approach. Done means large rows are isolated, oversized statements are split during restore, and a lost connection stops the restore with a clear message.
索引モデルが issue の本文から書いたものです。
説明
Describe the bug
Restoring a backup with large rows fails in the database step. BackWPup's dump batches rows into multi-row INSERTs and only starts a new one after the statement is already over 50000 characters, so a statement can take several multi-megabyte rows. When such a statement exceeds the database server's max_allowed_packet, the server drops the connection and data is lost.
To Reproduce
- Use a site with a large option row, e.g. All-In-One WP Security's
aiowps_plugin_checksums(about 16 MB with ~40 plugins). - Use a database server with the default
max_allowed_packetof 16 MB (MariaDB/MySQL default). - Create a backup including the database and restore it.
Observed
Database server log:
[Warning] Aborted connection ... (Got a packet bigger than 'max_allowed_packet' bytes)
With a direct mysqli connection, the restore log then contains hundreds of MySQL server has gone away errors and ends with ... SET FOREIGN_KEY_CHECKS = 1; everything after the failing statement is missing. In the reported case one INSERT INTO wp_options was about 18 MB (a 1.4 MB and a 16.7 MB row plus 50 small rows).
Expected behavior
Large rows are written into their own statement by the backup, oversized statements are split on restore, and a lost connection stops the restore with a clear message.
System
- BackWPup 5.7.8 (same dump/import code as 4.x)
- PHP 8.3, MariaDB with default
max_allowed_packet(16 MB)
A fix is ready as a pull request.
- 主要言語
- PHP
- スター
- 96
- フォーク
- 48
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
wp-media/backwpup のほかの issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
-
S3 backup list times are shifted by the site's UTC offset (timezone offset applied twice)再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
WordPress XML export: posts have no categories or tags since 5.6.6対応中かも @rafaelmaeuer が 14 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 25/100
-
Complete restore can leave the site half-restored対応中かも @rafaelmaeuer が 14 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 20/100
-
Complete restore stops after the file step: user is logged out, database is not restored対応中かも @rafaelmaeuer が 14 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
wp-media/backwpup の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 3 日以内に返信
-
sync-en
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信
-
[Sync EN] Formatting improvements to "Large Objects (LOBs)" docs (#6056)対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンsync-en
難易度 1/5 1時間未満 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信
-
Перевод устарел
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
メンテナーはふだん 1 日以内に返信
-
repo:cms
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
craftcms/cms#20613 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信