-
Notifications
You must be signed in to change notification settings - Fork 447
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: run MySQL 8.1 as a separate container during upgrade from Olive to Redwood #1140
fix: run MySQL 8.1 as a separate container during upgrade from Olive to Redwood #1140
Conversation
We do this because MySQL 8.1 does not have the --mysql-native-password option We have this option turned on for backwards compatibility
--character-set-server=utf8mb3 | ||
--collation-server=utf8mb3_general_ci |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
curious: What happens here if someone has already changed the connection strings on their Mysql57?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure as I have not tested this out, however, we would want this container to be as similar to the one already being launched in tutor v17. I'm not sure we want to cater to every modification a user might have made.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right.
tutor/commands/upgrade/compose.py
Outdated
hooks.Filters.ENV_PATCHES.add_item( | ||
( | ||
"local-docker-compose-services", | ||
""" | ||
mysql-8.1: | ||
extends: mysql | ||
image: docker.io/mysql:8.1.0 | ||
command: > | ||
mysqld | ||
--character-set-server=utf8mb3 | ||
--collation-server=utf8mb3_general_ci | ||
--binlog-expire-logs-seconds=259200 | ||
""", | ||
) | ||
) | ||
hooks.Filters.ENV_PATCHES.add_item( | ||
( | ||
"local-docker-compose-jobs-services", | ||
""" | ||
mysql-8.1-job: | ||
image: docker.io/mysql:8.1.0 | ||
depends_on: {{ [("mysql-8.1", RUN_MYSQL)]|list_if }} | ||
""", | ||
) | ||
) | ||
hooks.Filters.CONFIG_DEFAULTS.add_item(("MYSQL_HOST", "mysql-8.1")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Can't add_items be used for hooks.Filters.ENV_PATCHES here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated! Thank you for reminding me.
tutor_env.save(context.obj.root, config) | ||
context.invoke(jobs.initialise, limit="mysql") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is mysql version set to 8.4? Or is it 8.4 already before the code enters MySQL 8.1 context?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is already set prior to the context when the user installs tutor v18 onwards.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great! Can you add a changelog entry?
Updated with the changelog entry as well. |
…to Redwood (overhangio#1140) * ix: run MySQL 8.1 as a separate container during upgrade from Olive to Redwood We do this because MySQL 8.1 does not have the --mysql-native-password option We have this option turned on for backward compatibility
* fix: upgrade MySQL from 5.7 to 8.1 first and then to 8.4 This is required when upgrading from Tutor v15 to v18 directly MySQL does not allow direct upgrades from v5.7 to v8.4 * fix: run MySQL 8.1 as a separate container during upgrade from Olive to Redwood (#1140) We do this because MySQL 8.1 does not have the --mysql-native-password option We have this option turned on for backward compatibility
This PR is a fix for the issues brought forward in #1102.
We do this because MySQL 8.1 does not have the
--mysql-native-password
option and when upgrading from tutor v15 -> v18, this container would crash as the option does not exist.We have this option turned on for backwards compatibility from tutor v18.1.1 onwards as users who have upgraded all the way from MySQL v5.7 -> v8.4 have their original users created using the mysql_native_password authentication plugin. See #1090 for more details.
After this PR is merged in nightly, we should make a backport to master as well coupled with the changes already made in #1102.