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 initialization of mysqld #6

Merged
merged 9 commits into from
Feb 10, 2023
Merged

Conversation

jardon
Copy link
Contributor

@jardon jardon commented Feb 3, 2023

Issue

mysql was not initialized correctly

Solution

mysql is initialized with a startup script that creates the necessary folders and sets permissions

Context

Testing

Built, ran locally with docker. Need to throw the image in the associated charm for further testing.

Release Notes

Added initialization script
Created missing default directories
Set permissions for the mysql user

@jardon jardon marked this pull request as ready for review February 10, 2023 15:35
Copy link
Contributor

@paulomach paulomach left a comment

Choose a reason for hiding this comment

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

lgtm - left a minor comment, check if make sense

ln -sf /root/parts/packages-deb/install/usr/lib/x86_64-linux-gnu/libaio.so.1 /usr/lib/x86_64-linux-gnu/libaio.so.1
rm -rf /var/lib/mysql/
mysqld --initialize
cp -r /var/lib/mysql $CRAFT_STAGE/var/lib
Copy link
Contributor

Choose a reason for hiding this comment

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

does it make sense to use cp -ar here so it will preserve ownership (and avoid next line)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't believe that works because at the time of creation, the mysql user does not exist and so ownership has to be set to a user id which will eventually be the id for the mysql user that is created later.

I could be wrong about that, but from my understanding, that would be an issue.

Copy link
Contributor

@shayancanonical shayancanonical left a comment

Choose a reason for hiding this comment

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

Just a note: we were able to manually test the ROCK with mysql-k8s-operator (successfully deploying and scaling it)

@jardon jardon merged commit 1e456f2 into canonical:8.0-22.04 Feb 10, 2023
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.

4 participants