Refactor 0102_3_2_0_make_external_executor_id_text migration to support batch processing downgrade#63910
Open
jason810496 wants to merge 3 commits intoapache:mainfrom
Conversation
1 task
jason810496
commented
Mar 19, 2026
Member
Author
jason810496
left a comment
There was a problem hiding this comment.
There're some SQL syntax level failure, I will fix the CI later on.
airflow-core/src/airflow/migrations/versions/0102_3_2_0_make_external_executor_id_text.py
Outdated
Show resolved
Hide resolved
Member
|
I think this is on the right track (using batch and |
…rt batch processing downgrade
a99c0fe to
1884e55
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
As pointed out in #63625 (review), the original migration (and also the PR [migration-0102] Change logic migration data of postgresql) will hold the
ACCESS EXCLUSIVElock that blocks ALL the concurrent READ and WRITE, ForTaskInstanceandTaskInstanceHistorytables at production scale, even 4 minutes of total blocking is unacceptable. (e.g. downgrade from 3.2.0 to 3.1.8 due to other feature's error but encounter 8mins downtime)What
Instead we:
external_executor_id_newCOLUMN (instant, ~ms level, brief ACCESS EXCLUSIVE)ALTER TABLE task_instance ALTER COLUMN ... TYPE VARCHAR(250)DDLexternal_executor_id+ RENAMEexternal_executor_id_newtoexternal_executor_idin same TX (instant, ~ms level, brief ACCESS EXCLUSIVE)Was generative AI tooling used to co-author this PR?