Skip to content
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

Fix deprecated options from MySQL 8.2 #662

Conversation

laurent-indermuehle
Copy link
Collaborator

@laurent-indermuehle laurent-indermuehle commented Jul 19, 2024

SUMMARY

This PR:

  • Fixes compatibility issues in the mysql_db, mysql_info, and mysql_replication modules with MySQL versions 8.0.22, 8.0.23+, and 8.2+. Many terms have changed, such as MASTER -> REPLICATION SOURCE and MASTER_HOST -> SOURCE_HOST.
  • Fixes issues in integration tests where mysqldump 8.0 failed to dump MySQL 8.4 databases due to the change from MASTER to SOURCE.
  • Adds a new utility method called CommandResolver to simplify the code.

For the command resolver, I chose the oldest query form as a key (SHOW MASTER STATUS). I believe this is the best option since newer versions may differ between MariaDB and MySQL, ensuring that all keys remain homogeneous.

ISSUE TYPE
  • Bugfix Pull Request / Feature Pull Request
COMPONENT NAME
  • module_utils/command_resolver (new)
  • mysql_db
  • mysql_info
  • mysql_replication
ADDITIONAL INFORMATION

I inadvertently made a feature a duplicate (a second opinion would be appreciated) in the mysql_replication module. There were two options for the same functionality:

  • changeprimary <- I have made this compatible with MySQL 8.0.23 as well.
  • changereplication <- Should we consider deprecating this for simplicity?

@laurent-indermuehle laurent-indermuehle marked this pull request as ready for review July 25, 2024 07:30
@laurent-indermuehle
Copy link
Collaborator Author

laurent-indermuehle commented Jul 25, 2024

@dennisurtubia @betanummeric I realize now that I didn't consider #651 while working on this. I hope I didn't make things worst. In that case, I'm available to help fix things.

This PR is now ready for review.

Copy link
Collaborator

@Andersson007 Andersson007 left a comment

Choose a reason for hiding this comment

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

@laurent-indermuehle wow, i like it:) LGTM, thanks!

@Andersson007 Andersson007 merged commit cd9f4fc into ansible-collections:main Aug 5, 2024
47 checks passed
@laurent-indermuehle laurent-indermuehle deleted the lie_fix_master_vs_source_mysql82 branch August 5, 2024 07:50
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