Skip to content

Bump Serialized DAG to v2 and handle conversion from v1#49020

Merged
ashb merged 13 commits intoapache:mainfrom
astronomer:handle-v1-serdag
Apr 14, 2025
Merged

Bump Serialized DAG to v2 and handle conversion from v1#49020
ashb merged 13 commits intoapache:mainfrom
astronomer:handle-v1-serdag

Conversation

@dstandish
Copy link
Contributor

@dstandish dstandish commented Apr 9, 2025

A number of changes have been made to the serialized DAG structure between 2.x and 3.0, and with the addition of DAG versioning in 3.0 we can't use our old approach of simply force-reserializing all DAGs anymore.

So instead we bump the version record (that has been 1 since it was first introduced in 1.10.7, even though there were changes) and upgrade from the latest format in Airflow 2.x such that the Webserver will be able to display things for it.

The scheduler is not so easy to fix, so we use a proxy of "skip things that haven't been re-processed" yet by making the scheduler ignore DAGs that don't a bundle name set (as all dags processed in 3.0 have this set, even if it is for a local file bundle)

@dstandish dstandish self-assigned this Apr 9, 2025
dstandish and others added 12 commits April 14, 2025 15:00
- Make it less general purpose. YAGNI (You Ain't Gonna Need it) -- we can add
  it back in once we know what patterns make sense

- Make each conversion function deal with exactly one version, from it's
  version to the next. That way as the number of versions grow, we don't need
  to handle all new versions in all old migrations, we can just chaing
  v1_to_v2 -> v2_to_v3 etc.

- Upgrade schedule_interval to a timetable -- it is not complete yet
@ashb ashb force-pushed the handle-v1-serdag branch from aceceec to 47b0457 Compare April 14, 2025 14:03
@ashb ashb marked this pull request as ready for review April 14, 2025 14:04
@ashb ashb requested a review from XD-DENG as a code owner April 14, 2025 14:04
@ashb ashb force-pushed the handle-v1-serdag branch from 47b0457 to 540e10a Compare April 14, 2025 14:45
@ashb ashb requested a review from amoghrajesh as a code owner April 14, 2025 14:45
@ashb ashb force-pushed the handle-v1-serdag branch from e9f9b77 to 4a7c23f Compare April 14, 2025 16:26
@ashb ashb changed the title Handle v1 serdag conversion Bump Serialized DAG to v2 and handle conversion from v1 Apr 14, 2025
@ashb ashb linked an issue Apr 14, 2025 that may be closed by this pull request
2 tasks
@ashb
Copy link
Member

ashb commented Apr 14, 2025

Failing docs build fixed by #49240

@ashb ashb merged commit bd8941d into apache:main Apr 14, 2025
92 of 93 checks passed
@ashb ashb deleted the handle-v1-serdag branch April 14, 2025 20:12
@dstandish dstandish added this to the Airflow 3.0.0 milestone Apr 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Scheduler crashing when migrated with 2.10.5 DAGRUNS

4 participants