Handle Serialized DAG Format from v3 to v2 when downgrading Airflow#55975
Handle Serialized DAG Format from v3 to v2 when downgrading Airflow#55975kaxil merged 1 commit intoapache:mainfrom
Conversation
jedcunningham
left a comment
There was a problem hiding this comment.
Self-correcting: On the next DAG processing cycle, the dag processor will detect the hash mismatch and update both the serialized data and dag_hash to maintain consistency
Pretty sure it will only fix the latest, if there are no runs... Older versions will be left in a not-consistent state long term. Might not break anything, but isn't great...
...ow-core/src/airflow/migrations/versions/0085_3_1_0_downgrade_serialized_dag_version_to_v2.py
Show resolved
Hide resolved
This migration enables Airflow downgrades by converting v3 serialized DAGs back to v2 format. The `upgrade()` is a no-op since the server handles v1/v2/v3 at runtime, but `downgrade()` removes client_defaults sections and updates version numbers to ensure compatibility with older Airflow versions. closes apache#55949
Improves storage efficiency and query performance for DAG serialization data by using PostgreSQL's native `JSONB` type instead of `JSON`. `JSONB` provides better compression, faster equality comparisons, and removes whitespace/duplicate keys. Would have also made the query in apache#55975 simpler.
|
Testing Steps for testing
|
|
fyi I checked (fyi @ephraimbuddy ) |
…55975) This migration enables Airflow downgrades by converting v3 serialized DAGs back to v2 format. The `upgrade()` is a no-op since the server handles v1/v2/v3 at runtime, but `downgrade()` removes client_defaults sections and updates version numbers to ensure compatibility with older Airflow versions. closes #55949 (cherry picked from commit 3299567)
Improves storage efficiency and query performance for DAG serialization data by using PostgreSQL's native `JSONB` type instead of `JSON`. `JSONB` provides better compression, faster equality comparisons, and removes whitespace/duplicate keys. Would have also made the query in apache#55975 simpler.
Improves storage efficiency and query performance for DAG serialization data by using PostgreSQL's native `JSONB` type instead of `JSON`. `JSONB` provides better compression, faster equality comparisons, and removes whitespace/duplicate keys. Would have also made the query in #55975 simpler.
…pache#55975) This migration enables Airflow downgrades by converting v3 serialized DAGs back to v2 format. The `upgrade()` is a no-op since the server handles v1/v2/v3 at runtime, but `downgrade()` removes client_defaults sections and updates version numbers to ensure compatibility with older Airflow versions. closes apache#55949 (cherry picked from commit 3299567)
…pache#55975) This migration enables Airflow downgrades by converting v3 serialized DAGs back to v2 format. The `upgrade()` is a no-op since the server handles v1/v2/v3 at runtime, but `downgrade()` removes client_defaults sections and updates version numbers to ensure compatibility with older Airflow versions. closes apache#55949 (cherry picked from commit 3299567)
…pache#55975) This migration enables Airflow downgrades by converting v3 serialized DAGs back to v2 format. The `upgrade()` is a no-op since the server handles v1/v2/v3 at runtime, but `downgrade()` removes client_defaults sections and updates version numbers to ensure compatibility with older Airflow versions. closes apache#55949 (cherry picked from commit 3299567)
…pache#55975) This migration enables Airflow downgrades by converting v3 serialized DAGs back to v2 format. The `upgrade()` is a no-op since the server handles v1/v2/v3 at runtime, but `downgrade()` removes client_defaults sections and updates version numbers to ensure compatibility with older Airflow versions. closes apache#55949 (cherry picked from commit 3299567)
…pache#55975) This migration enables Airflow downgrades by converting v3 serialized DAGs back to v2 format. The `upgrade()` is a no-op since the server handles v1/v2/v3 at runtime, but `downgrade()` removes client_defaults sections and updates version numbers to ensure compatibility with older Airflow versions. closes apache#55949 (cherry picked from commit 3299567)
This migration enables Airflow downgrades by converting v3 serialized DAGs back to v2 format. The
upgrade()is a no-op since the server handles v1/v2/v3 at runtime, butdowngrade()removes client_defaults sections and updates version numbers to ensure compatibility with older Airflow versions.closes #55949
Note on
dag_hashbehavior:The migration does not update the
dag_hashcolumn when modifying DAG data. The DAG processor will only fix the hash for the latest record on next processing - older records will remain with inconsistenthashes permanently.
The hash mismatch is a natural consequence of modifying existing serialized DAG data and does not require manual intervention.
^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named
{pr_number}.significant.rstor{issue_number}.significant.rst, in airflow-core/newsfragments.