You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/09/21 15:36:24 UTC
[GitHub] [airflow] windmark opened a new issue, #26561: Downgrading migrations fails on xcom pkey
windmark opened a new issue, #26561:
URL: https://github.com/apache/airflow/issues/26561
### Apache Airflow version
Other Airflow 2 version
### What happened
Hi,
I'm trying to downgrade the Airflow DB migrations and the [0102_2_3_0_switch_xcom_table_to_use_run_id.py](https://github.dev/apache/airflow/blob/2.3.4/airflow/migrations/versions/0102_2_3_0_switch_xcom_table_to_use_run_id.py#L174) seems to not handle the `xcom_pkey` to `pk_xcom` downgrade properly.
This fails in combination with the downgrade of [0060_2_0_0_remove_id_column_from_xcom.py](https://github.dev/apache/airflow/blob/88b274c95b212b541ba19918880ae425856212be/airflow/migrations/versions/0060_2_0_0_remove_id_column_from_xcom.py#L125) since the xcom table does not have an `pk_xcom`.
### What you think should happen instead
DB migrations should be compatible with each other and downgrading [0102_2_3_0_switch_xcom_table_to_use_run_id.py](https://github.dev/apache/airflow/blob/2.3.4/airflow/migrations/versions/0102_2_3_0_switch_xcom_table_to_use_run_id.py#L174) should properly recreate the `pk_xcom` it replaces on the upgrade.
### How to reproduce
1. Create an empty Airflow DB with latest migrations of anything >=2.3.0
2. Run `airflow db downgrade --to-revision bbf4a7ad0465` to downgrade to [0060_2_0_0_remove_id_column_from_xcom.py](https://github.dev/apache/airflow/blob/88b274c95b212b541ba19918880ae425856212be/airflow/migrations/versions/0060_2_0_0_remove_id_column_from_xcom.py#L125)
The result is the error `constraint "pk_xcom" of relation "xcom" does not exist` when applying the target revision.
### Operating System
Linux
### Versions of Apache Airflow Providers
```
apache-airflow==2.3.4
apache-airflow-providers-common-sql==1.2.0
apache-airflow-providers-ftp==3.1.0
apache-airflow-providers-http==4.0.0
apache-airflow-providers-imap==3.0.0
apache-airflow-providers-sqlite==3.2.1
```
### Deployment
Other 3rd-party Helm chart
### Deployment details
_No response_
### Anything else
_No response_
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
--
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: commits-unsubscribe@airflow.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] windmark commented on issue #26561: Downgrading migrations fails on xcom pkey
Posted by GitBox <gi...@apache.org>.
windmark commented on issue #26561:
URL: https://github.com/apache/airflow/issues/26561#issuecomment-1253927522
The issue is that the primary key name `pk_xcom` isn't passed explicitly as an argument and the pk thus takes the name of the temporary table `__airflow_tmp_xcom_pkey`. This is for some reason handled in `mssql` but not for example in Postgres that I'm using.
I'm however not sure how Airflow handles bugs in migrations, with backporting to already released versions. Otherwise I can help out fix the issue.
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] github-actions[bot] closed issue #26561: Downgrading migrations fails on xcom pkey
Posted by GitBox <gi...@apache.org>.
github-actions[bot] closed issue #26561: Downgrading migrations fails on xcom pkey
URL: https://github.com/apache/airflow/issues/26561
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] github-actions[bot] commented on issue #26561: Downgrading migrations fails on xcom pkey
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on issue #26561:
URL: https://github.com/apache/airflow/issues/26561#issuecomment-1299382291
This issue has been closed because it has not received response from the issue author.
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] potiuk commented on issue #26561: Downgrading migrations fails on xcom pkey
Posted by GitBox <gi...@apache.org>.
potiuk commented on issue #26561:
URL: https://github.com/apache/airflow/issues/26561#issuecomment-1253957670
Feel free to update downgrade directly in the migration that is problematic. We aren't going to backport it to anything else than 2.4.* most likely and you can simply add it to `main` - but check it please if it's not already fixed in main, because it could be fixed already (and not backported as we stop backporting bugfixes when we release a new minor line,).
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] boring-cyborg[bot] commented on issue #26561: Downgrading migrations fails on xcom pkey
Posted by GitBox <gi...@apache.org>.
boring-cyborg[bot] commented on issue #26561:
URL: https://github.com/apache/airflow/issues/26561#issuecomment-1253882430
Thanks for opening your first issue here! Be sure to follow the issue template!
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] github-actions[bot] commented on issue #26561: Downgrading migrations fails on xcom pkey
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on issue #26561:
URL: https://github.com/apache/airflow/issues/26561#issuecomment-1289809907
This issue has been automatically marked as stale because it has been open for 30 days with no response from the author. It will be closed in next 7 days if no further activity occurs from the issue author.
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org