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

Using MS SQL Server 17 as a backend, Migration cc1e65623dc7_add_max_tries_column_to_task_instance.py fails if load_examples = True

    XMLWordPrintableJSON

    Details

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

      Description

      This took me a while to figure out as there was another issue with the migration in question which is cc1e65623dc7_add_max_tries_column_to_task_instance.py

      This file USED to have an issue where it would sit there forever during an initdb on MS SQL Server, essentially deadlocked with itself.

      I couldn't figure out why it was still sitting there for me, given that I was using the version of the migration where this had been fixed, so I went looking at the locks on the DB.  I found TWO processes running on the DB both originating inside the airflow initdb Python instance.

      The first was happily sitting there trying to query the max_retries column on a table, but the other was attempting to query the table "slot_pool" from within example_subdag_operator.py .  I killed the session which was querying that table and of course my Python process crashed, helpfully with a stack trace.

      The session I killed was interacting with the DB running in EXAMPLES and was actually complaining that the table was not a valid object name.  As soon as I set load_examples = False, the initdb process ran through in a few seconds and all was well.  But with load_examples = True it would reliably hang on this specific migration every single time.

      I have attached a full stack trace from when I terminated the second DB session.

        Attachments

        1. airflow-mssql-stack-trace.txt
          13 kB
          Tony Brookes
        2. image-2020-04-20-18-14-10-275.png
          36 kB
          Sam T

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                brooked Tony Brookes
              • Votes:
                1 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated: