Allow queuing/deletion of batched migration in transaction
What does this MR do and why?
With !87715 (merged) we require queue_batched_background_migration
and delete_batched_background_migration
not to run in transaction. This stated to cause problems for migrations tests during development:
- https://gitlab.slack.com/archives/C3NBYFJ6N/p1655474986285259
- https://gitlab.slack.com/archives/C3NBYFJ6N/p1655149616529469
- !88545 (comment 967969807)
With the promotion of batched migrations as the default and recommended way to do background migrations we'll see more of these complaints, which result in slowed down development and less than ideal experience for developers.
Seems like the root cause is in the way we revert the schema between test examples, more details can be found here - !88545 (comment 968494255).
While we should look into this and fix it, as it's not the expected behavior, I think we should just allow this two helpers to run inside a transaction. They execute only DML statements (SELECT/INSERT/DELETE) and there is no reason to restrict them this way, other than "Let's do all batched migration operation outside transaction".
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.