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(orca-sql): Add migration for mariadb support #4779

Merged
merged 4 commits into from
Sep 17, 2024

Conversation

juangod-wise
Copy link
Contributor

@juangod-wise juangod-wise commented Sep 6, 2024

This contribution was discussed in this slack thread:

https://spinnakerteam.slack.com/archives/C7J1CU4LA/p1722343931881969?thread_ts=1710447204.964799&cid=C7J1CU4LA

In summary:

The migration in 20201214-create-compressed-executions-table.yaml that is adding the column compression_type is not being ran for MariaDB because it contains dbms: mysql. This causes Orca to throw the following error on startup if using MariaDB:

liquibase.exception.DatabaseException: Unknown data type: 'COMPRESSION_TYPE_ENUM' [Failed SQL: (4161) ALTER TABLE spinnaker_orca.pipelines_compressed_executions ADD compression_type COMPRESSION_TYPE_ENUM DEFAULT 'ZLIB' NOT NULL

This happens because, since the column is not being created on that migration, the Postgres migration is ran because of this conditional:

preConditions:
onFail: MARK_RAN
not:
columnExists:
tableName: pipelines_compressed_executions
columnName: compression_type

And running the Postgres migration on MariaDB causes the error to appear. The solution for this is to create a new migration for MariaDB that is executed before the Postgres migration that adds the column only if using MariaDB. We can't change previous migrations because the changeset hash would change and would start failing for everyone who already applied it.

Spinnaker should be able to support MariaDB as there are mentions in the documentation:

https://spinnaker.io/docs/setup/productionize/persistence/orca-sql/#mariadb

@dbyron-sf dbyron-sf added the ready to merge Approved and ready for merge label Sep 17, 2024
@mergify mergify bot added the auto merged Merged automatically by a bot label Sep 17, 2024
@mergify mergify bot merged commit 7068d30 into spinnaker:master Sep 17, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto merged Merged automatically by a bot ready to merge Approved and ready for merge target-release/1.36
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants