Skip to content

fix(migration): purge global db binary logs#82

Open
mrrobot47 wants to merge 2 commits into
EasyEngine:developfrom
mrrobot47:fix/purge-mariadb-binlogs
Open

fix(migration): purge global db binary logs#82
mrrobot47 wants to merge 2 commits into
EasyEngine:developfrom
mrrobot47:fix/purge-mariadb-binlogs

Conversation

@mrrobot47

Copy link
Copy Markdown
Member

Summary

  • Add a one-time container migration to clean up MariaDB binary logs from existing EasyEngine installs.
  • Detect EasyEngine's default binlog basename before destructive cleanup.
  • Run RESET MASTER for the running global DB when the default binlog is active.
  • Remove EasyEngine's default binlog directives from persisted ee.cnf.
  • Copy the cleaned config into the existing global DB container when needed.
  • Restart global-db with a retry-safe restart marker.
  • Delete only default-named mariadb-bin.NNNNNN and mariadb-bin.index files.

Why

The MariaDB image previously enabled binlogs by default for the global DB even though EasyEngine does not manage replication. Existing installs keep both config and logs in persistent volumes, so an image-only fix does not clean up affected installs.

Safety

  • Skips fresh installs.
  • Preserves operator-customized binlog basenames.
  • Does not delete arbitrary mariadb-bin* files.
  • Uses a restart-pending marker so a retry completes the DB restart after partial failure.
  • Does not attempt rollback for purged binlogs, because RESET MASTER and file deletion are intentionally irreversible.

Release Notes

This PR must be released with:

  • An EasyEngine Dockerfiles tag containing the MariaDB image config fix.
  • An EasyEngine release that bumps easyengine/service-command in composer.json/composer.lock.
  • An EasyEngine release that bumps easyengine/mariadb in img-versions.json.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a one-time container migration that disables EasyEngine’s default global MariaDB binlog configuration, safely purges only the default-named binlog files, and coordinates a retry-safe global-db restart when required—addressing persistent volumes on existing installs.

Changes:

  • Introduces a new migration to detect the default binlog basename and (when safe) run RESET MASTER before cleanup.
  • Removes EasyEngine’s default binlog directives from persisted mariadb/conf/conf.d/ee.cnf and copies the updated config into the running container when possible.
  • Deletes only default-named mariadb-bin.NNNNNN and mariadb-bin.index files and uses a restart marker to safely complete restarts after partial failures.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread migrations/container/20260708120000_service-command_disable_global_db_binlogs.php Outdated
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.

2 participants