Skip to content

Merge users from parent clusters with current users without changing credentials #1125

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from

Conversation

caffeinated92
Copy link
Collaborator

This pull request introduces enhancements to the backup and restore functionality for MySQL/MariaDB clusters, focusing on user data handling during logical backups and reseeding. Key changes include the addition of a new method for restoring MySQL user data, updates to existing methods to handle user data more effectively, and improvements to ensure compatibility with specific database versions.

Enhancements to Backup and Restore Functionality:

  • New Method for Restoring User Data: Added JobReseedMysqldumpUser to handle the restoration of MySQL user data during reseeding. This method processes the mysql.user file, removes sensitive information (e.g., IDENTIFIED BY clauses), and applies the data to the target server (cluster/srv_job.go, cluster/srv_job.goR1028-R1076).

  • Improved Logical Backup Handling:

    • Updated JobBackupLogical to always dump MySQL user data for reusable backups, ensuring compatibility with MariaDB 10.4+ (cluster/srv_job.go, cluster/srv_job.goL2166-R2217).
    • Renamed the output file for user data backups from mysql.users.sql.gz to mysql.user.sql.gz for consistency (cluster/srv_job.go, cluster/srv_job.goL1875-R1923).

Modifications to Existing Methods:

  • Enhanced User Restoration in Reseeding:

    • Updated JobReseedMyLoader to invoke JobReseedMysqldumpUser when restoring user data, simplifying the logic for handling mysql.user files (cluster/srv_job.go, [1] [2].
    • Adjusted JobReseedMysqldump to include additional checks for restoring user data based on metadata (cluster/srv_job.go, cluster/srv_job.goL1143-R1179).
  • Refactored ReadMysqldumpUser:

    • Changed the parameter from backupfile to dir for better clarity and flexibility.
    • Enhanced the method to clean user data by removing sensitive details before processing (cluster/srv_job.go, [1] [2] [3].

These changes improve the robustness and security of the backup and restore processes, particularly for user data, while ensuring compatibility with newer database versions.

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