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.