-
Notifications
You must be signed in to change notification settings - Fork 21
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
[AN-257] Pin mysql to 8.4 for local leo and unit tests #4819
[AN-257] Pin mysql to 8.4 for local leo and unit tests #4819
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #4819 +/- ##
========================================
Coverage 74.62% 74.62%
========================================
Files 166 166
Lines 14692 14692
Branches 1135 1135
========================================
Hits 10964 10964
Misses 3728 3728 Continue to review full report in Codecov by Sentry.
|
Mysql 8.4+ does not allow partial keys to be referenced for a foreign key anymore, see https://bugs.mysql.com/bug.php?id=114838. | ||
This changeSet has been modified to reflect that; the validCheckSum is the checksum from when the flag did not need to be set because the default was OFF. | ||
</comment> | ||
<sql> SET restrict_fk_on_non_standard_key = OFF; </sql> |
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 retroactive change would allow this Liquibase to run on a brand new MySQL 8.4 – what happens for existing CloudSQL instances like Prod?
I wonder if we also need a new changeset that will run on those and idempotently set this flag.
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 worked great on a preexisting BEE DB, but I can wait until I test the existing dev DB first before merging this that's a good callout
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'm also cool with merging as-is and revisiting in a follow-on; since this PR refers to local & tests.
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 does, but there is no rush to merge this, I can test mycloud sql locally too
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.
Everything works great on a dev clone locally. Adding the changeset would not impact the pre-existing database so this is safe to merge as is. I will bring up the issue of potentially drifting our DB config between Broad and Manifold at the tech lead round table though.
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.
Sounds good.
I wonder whether Liquibase sets it as a global or session variable. If session, then new & old instances wouldn't drift at all.
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 can be set as both, see https://dev.mysql.com/doc/refman/8.4/en/server-system-variables.html#sysvar_restrict_fk_on_non_standard_key
But in this case it is a session variable, because I did not set it as SET GLOBAL
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.
Clearly an improvement; provisional thumb in case you decide to address existing CloudSQLs seprately.
Jira ticket: https://broadworkbench.atlassian.net/browse/AN-257
Summary of changes
What
Slight changes to some liquibase migration files to adapt to the mysql 8.0 -> 8.4 breaking changes around allowing FK to reference from a partial PK. Note that I added the checksum validations for each table as to not break dev and staging like [AN-256] Update mysql version to 8.0 for unit test and local leo #4802 did 🤦♀️
Why
Testing these changes
Note that we need to first merge this terra helmfile PR to update swatomation BEEs to use 8.4, then the integration tests on this PR will pass. We should then merge this PR ASAP otherwise BEE creation will fail for everybody else 😬
What to test
Who tested and where
jenkins retest
orjenkins multi-test
.