Skip to content

Fix MySQL backups with generated search columns - #184

Merged
zhenghaoz merged 3 commits into
masterfrom
fix/mysql-generated-column-backups
Oct 5, 2026
Merged

zhenghaoz merged 3 commits into
masterfrom
fix/mysql-generated-column-backups

Conversation

@zhenghaoz

Copy link
Copy Markdown
Collaborator

Backups produced by the MariaDB client against MySQL include explicit values for the generated items.gorse_search_document column, causing restores to fail with ERROR 3105. Use the official MySQL 8.4 client in the backup image and export INSERTs with explicit column lists so generated columns are omitted and recomputed during restore.

The backup script also uses a consistent transaction snapshot, disables column statistics and GTID output for portability, rejects MariaDB dump clients, and enables pipefail so failed exports cannot be uploaded as successful backups.

Validation:

  • Built the updated backup Docker image and checked MySQL, s3cmd, and gzip availability.
  • Used the new container to dump and restore a test table with a stored generated column and FULLTEXT index on MySQL 8.0.32; verified restored generated values and removed the test table.
  • Verified MariaDB clients and failed dumps stop before S3 upload using command stubs.
  • Passed bash -n scripts/backup.sh and git diff --check.

Rebuild the backup service to apply: docker compose up -d --build backup. Existing backups are unchanged and may still require repair.

@zhenghaoz
zhenghaoz merged commit 43953af into master Oct 5, 2026
1 check passed
@zhenghaoz
zhenghaoz deleted the fix/mysql-generated-column-backups branch October 5, 2026 01:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant