potiuk commented on code in PR #41207:
URL: https://github.com/apache/airflow/pull/41207#discussion_r1703767280
##########
airflow/utils/db.py:
##########
@@ -1660,11 +1660,14 @@ def upgradedb(
if errors_seen:
exit(1)
- if not to_revision and not _get_current_revision(session=session) and not
use_migration_files:
+ current_revision = _get_current_revision(session=session)
Review Comment:
Agree. Likely not good idea.
But sctually I think there is a problem with current solution. I think it
does not work as intended - beuase when migration actually happens in another
process, previous_revision will still be as it was when we started.
I think we will need to to just add:
```
previous_revision = current_revision = _get_current_revision(session=session)
```
right after qcquiring the lock.
At this point the database might already be migrated - if the migration
happened in another processs - so both "previous revision" and "current
revision" will be already different than before the lock.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]