Uploaded image for project: 'Apache Airflow'
  1. Apache Airflow
  2. AIRFLOW-2268

upgradedb is not idempotent

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 1.9.0
    • Fix Version/s: None
    • Component/s: database
    • Labels:

      Description

      if upgradedb fails in the middle and you try to run it again you can receive fatal errors, e.g.:

      (from upgradedb for airflow 1.9)
      sqlalchemy.exc.OperationalError: (_mysql_exceptions.OperationalError) (1060, "Duplicate column name 'max_tries'") [SQL: u"ALTER TABLE task_instance ADD COLUMN max_tries INTEGER DEFAULT '-1'"]

      solution: make upgradedb idempotent by using transactions that rollback on failure.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              sulphide sulphide
            • Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: