Skip to content

Allow Airflow DB upgrades/migrations to be on-demand #589

@adwk67

Description

@adwk67

Please talk to @adwk67 before starting work on this

Related to SUP-174 and SUP-199

At the moment, upgrades to the airflow database occur every time the scheduler starts up: see here and here. This can cause significant overhead, depending on the number and complexity of DAGs (as well as delays in the scheduler being available). This ticket will cover the following:

  • replacing airflow db upgrade with airflow db migrate (as the former has been deprecated)
  • making the migration on demand via e.g. a new field in the resource
  • We need to make sure we don't introduce problems similar to the AirflowDB resource in the past (e.g. don't run a migration after a Airflow version bump), see Removed AirflowDB #322

(from below)

Proposal

  • add a flag to bypass db migration and user creation, defaulting to true in both cases (so it's not breaking)
  • extend the airflow demo using a DAG factory and setting AIRFLOW__CORE__MIN_SERIALIZED_DAG_UPDATE_INTERVAL to a different default setting (this is better than an integration test as it is somewhat of a corner-case, is defficult to verify in a test but simple to docuemtn as part of the demo)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Ready for Development

    Status

    In Refinement

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions