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

[bugfix] create admin_account_actions table in tx #940

Merged

Conversation

terinjokes
Copy link
Contributor

The migration that adds the admin_account_actions table did so at the same time as adding indexes onto the new table. This code was ran inside a RunInTx function, but the table creation did not use the transaction reference, while the creation of the indexes did. This could cause a race between the table and index creations, depending on the scheduling order. If the table creation did not win the race, then the migration would fail.

This changeset corrects the table creation to also be done inside the same transaction as the index creation.

Signed-off-by: Terin Stock terinjokes@gmail.com

The migration that adds the `admin_account_actions` table did so at the
same time as adding indexes onto the new table. This code was ran inside
a `RunInTx` function, but the table creation did not use the transaction
reference, while the creation of the indexes did. This could cause a
race between the table and index creations, depending on the scheduling
order. If the table creation did not win the race, then the migration
would fail.

This changeset corrects the table creation to also be done inside the
same transaction as the index creation.

Signed-off-by: Terin Stock <terinjokes@gmail.com>
@tsmethurst
Copy link
Contributor

nice, thanks!

@tsmethurst tsmethurst merged commit 4a925e4 into superseriousbusiness:main Nov 1, 2022
@terinjokes terinjokes deleted the fix/admin_account_actions branch November 1, 2022 14:33
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.

None yet

2 participants