kaxil commented on code in PR #74892:
URL: https://github.com/apache/airflow/pull/74892#discussion_r4299785497


##########
airflow-core/src/airflow/migrations/versions/0143_3_4_0_add_dynamic_region_storage.py:
##########
@@ -157,6 +157,10 @@ def upgrade():
             sa.Column("parent_region_id", CompactUUID(), nullable=True),
             sa.Column("parent_region_index", sa.Integer(), nullable=True),
             sa.Column("forked_from_region_id", CompactUUID(), nullable=True),
+            sa.Column("family_root_id", CompactUUID(), nullable=False),

Review Comment:
   A 3.4.0b1 database is already stamped past this revision (b1 shipped 0143 to 
0146), so `airflow db migrate` won't add these columns and nothing tells the 
user. The first sign is a missing `family_root_id` error from 
`DynamicRegion.get_or_create_many`, which `_create_tasks` calls for every 
mapped task, so a b1 user who never wrote a loop hits it too. Could we add a 
check to `_check_migration_errors` in `utils/db.py` that stops with a "migrated 
by 3.4.0b1, downgrade or reset" message when `dynamic_region` has no 
`family_root_id`? `upgradedb` already exits on those before running any 
migration.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to