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

Recover from hook errors when creating/deleting MySQL users #165

Merged
merged 1 commit into from
Nov 28, 2023

Conversation

carlcsaposs-canonical
Copy link
Contributor

Fixes #157

Previously, the charm assumed that if a user was created or deleted that the databag would be updated accordingly. However, if a user is created or deleted and the event/hook fails, the user creation/deletion will go through for MySQL but the databag will not be updated (since the event failed). When the event is retried, the charm tried to create a user that already exists or delete a user that doesn't exist

Fixes #157

Previously, the charm assumed that if a user was created or deleted that the databag would be updated accordingly. However, if a user is created or deleted and the event/hook fails, the user creation/deletion will go through for MySQL but the databag will not be updated (since the event failed). When the event is retried, the charm tried to create a user that already exists or delete a user that doesn't exist
Copy link
Contributor

@taurus-forever taurus-forever left a comment

Choose a reason for hiding this comment

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

Nice catch!

@carlcsaposs-canonical carlcsaposs-canonical merged commit fad69b1 into main Nov 28, 2023
10 checks passed
@carlcsaposs-canonical carlcsaposs-canonical deleted the fix-user-hook-error branch November 28, 2023 13:54
carlcsaposs-canonical added a commit to canonical/mysql-router-operator that referenced this pull request Mar 5, 2024
carlcsaposs-canonical added a commit to canonical/mysql-router-operator that referenced this pull request Mar 5, 2024
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.

CREATE USER fails in subsequent hooks if bootstrap fails after creating user
3 participants