feat(cmangos-database): nightly logical (mysqldump) backups - #4109
Open
xunholy wants to merge 1 commit into
Open
feat(cmangos-database): nightly logical (mysqldump) backups#4109xunholy wants to merge 1 commit into
xunholy wants to merge 1 commit into
Conversation
Adds restorable SQL-dump backups of the irreplaceable game DBs to complement the existing crash-consistent RBD snapshot. The live DBs are mixed-engine (classiccharacters: 79 InnoDB + 13 MyISAM; classicrealmd: mostly small MyISAM), and MyISAM isn't safe to restore from a raw volume snapshot taken mid-write — a logical dump is. - pvc-dumps.yaml: dedicated 10Gi PVC for the dumps - backup-cronjob.yaml: nightly (03:00) mariadb-dump of classicrealmd + classiccharacters, gzipped + timestamped, keep newest 7 per DB. Uses the app user (SELECT is enough for --single-transaction --no-tablespaces; verified against the live DB). classicmangos (world) is omitted — it's reconstructible via init-db + the in-repo migrations; classiclogs is disposable. - replicationsource-dumps.yaml: VolSync ships the dumps PVC to Kopia at 05:00, reusing the existing repo secret; retain daily:7 weekly:4. --single-transaction is consistent for the InnoDB bulk (all player rows) with no write-blocking; the few small MyISAM tables are best-effort. Upgrade to a privileged backup user + --lock-all-tables once live root is rotated (after the PTR DB split lands and decouples the on-main db-init from root).
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
k8s-gitops | 33e463a | Commit Preview URL Branch Preview URL |
Jun 25 2026, 04:07 AM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds restorable SQL-dump backups of the irreplaceable game DBs, complementing the existing hourly crash-consistent RBD snapshot.
Why
The live DBs are mixed-engine (verified on the running instance):
classiccharactersclassicrealmdMyISAM tables aren't safe to restore from a raw volume snapshot taken mid-write — a logical dump is. The RBD snapshot stays as the fast-restore tier; these dumps are the correctness tier.
Changes (all in the
cmangos-databaseapp)pvc-dumps.yaml— dedicated 10Gi PVC for the dumps.backup-cronjob.yaml— nightly (03:00)mariadb-dumpofclassicrealmd+classiccharacters, gzipped + timestamped, keep newest 7 per DB. Runs as a non-root user; uses the app user (SELECTis enough for--single-transaction --no-tablespaces).replicationsource-dumps.yaml— VolSync ships the dumps PVC to Kopia at 05:00, reusing the existing repo secret;retain: daily 7 / weekly 4.classicmangos(world) is intentionally not dumped — reconstructible viainit-db+ the in-repo migration Jobs.classiclogsis disposable.Consistency note
--single-transactiongives a consistent snapshot of the InnoDB bulk (all player rows) with no write-blocking; the few small MyISAM tables are best-effort. Upgrade path: a privileged backup user +--lock-all-tablesonce live root is rotated (after the PTR DB split decouples the on-maindb-initfrom root=password).Validation
classicrealmddumped 425 KB gzipped of real data;classiccharactersschema dumped exit 0. SoSELECTsuffices.kustomize buildapp dir → CronJob + dumps PVC + dumps ReplicationSource render$$-escaping de-escaped andbash -n-checked → valid runtime scripthttps://claude.ai/code/session_01T37E9UJr2ymcGhQoV8Yq93