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

Drop explicit transaction from store_node_tokens_as_encrypted_value #3280

Merged
merged 1 commit into from
Apr 21, 2021

Conversation

tari
Copy link
Contributor

@tari tari commented Apr 20, 2021

Migrations are executed in transactions anyway, and creating a savepoint can cause
spurious failures on databases that don't support transactional DDL (like
MySQL and MariaDB) when it attempts to commit a savepoint that was silently
not created because there wasn't an active transaction after some DDL was
executed.

While a better solution might involve splitting this migration into several so each
one is only DDL or only data manipulation, I don't think that can be done very
easily while maintaining compatibility with existing deployments.

Fixes #3229.

Migrations are executed in transactions anyway, and creating a savepoint can cause
spurious failures on databases that don't support transactional DDL (like
MySQL and MariaDB) when it attempts to commit a savepoint that was silently
not created because there wasn't an active transaction after some DDL was
executed.

While a better solution might involve splitting this migration into several so each
one is only DDL or only data manipulation, I don't think that can be done very
easily while maintaining compatibility with existing deployments.

Fixes pterodactyl#3229.
@DaneEveritt
Copy link
Member

This might not matter since it probably affects other migrations too, but do you know if this will cause the dry-run for migrations to accidentally execute this logic? I've run into that in the past but I'm not sure how I avoided it.

@tari
Copy link
Contributor Author

tari commented Apr 20, 2021

migrate --pretend seems to avoid running any actual queries against the database, so I don't think this change will affect that.

@DaneEveritt DaneEveritt merged commit db64f54 into pterodactyl:develop Apr 21, 2021
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.

Migration store_node_tokens_as_encrypted_value fails: savepoint does not exist
2 participants