Skip to content

Conversation

@ashb
Copy link
Member

@ashb ashb commented Apr 3, 2025

We want to update the task instance and ti history tables to have a unique id
per attempt (this row id will be used in the strong identity token issued to
reach TI attempt.)

While this was possible with the previous implementation of having id and
try_id columns on the TaskInstance table it introduces confusion in the API,
and breaks some fundamental assumptions in the Execution API.

The only real changes needed to make this work (outside of some changes in
tests) as to set ON UPDATE CASCADE on task note (as notes are by design
across all task retries), and to delete from the TaskReschedule table when
retrying a task, which is good anyway as it stops that table growing without
bound.

Closes #44975


^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in airflow-core/newsfragments.

@boring-cyborg boring-cyborg bot added the area:API Airflow's REST/HTTP API label Apr 3, 2025
@ashb ashb force-pushed the remove-try_id-from-ti branch 4 times, most recently from cf203cb to 80a8071 Compare April 9, 2025 12:00
@ashb ashb force-pushed the remove-try_id-from-ti branch 2 times, most recently from 655ae65 to 67f83c4 Compare April 9, 2025 23:06
@ashb ashb added the full tests needed We need to run full set of tests for this PR to merge label Apr 10, 2025
@ashb ashb marked this pull request as ready for review April 10, 2025 09:21
@ashb
Copy link
Member Author

ashb commented Apr 10, 2025

Needs a pr desc etc, but I want to see tests

@ashb ashb force-pushed the remove-try_id-from-ti branch from 67f83c4 to 55e522a Compare April 10, 2025 09:49
@ashb ashb force-pushed the remove-try_id-from-ti branch from 55e522a to cdfbbdc Compare April 10, 2025 12:06
@ashb ashb changed the title Remove/undo the try_id+id on TaskInstance table. Ensure that TI.id is unique per try. Apr 10, 2025
@ashb ashb force-pushed the remove-try_id-from-ti branch from 035bf49 to bd8f902 Compare April 10, 2025 12:15
We want to update the task instance and ti history tables to have a unique id
per attempt (this row id will be used in the strong identity token issued to
reach TI attempt.)

While this was possible with the previous implementation of having `id` and
`try_id` columns on the TaskInstance table it introduces confusion in the API,
and breaks some fundamental assumptions in the Execution API.

The only real changes needed to make this work (outside of some changes in
tests) as to set `ON UPDATE CASCADE` on task note (as notes are by design
across all task retries), and to delete from the TaskReschedule table when
retrying a task, which is good anyway as it stops that table growing without
bound.

Closes apache#44975
@ashb ashb force-pushed the remove-try_id-from-ti branch from bd8f902 to fc20c71 Compare April 10, 2025 12:57
@kaxil kaxil merged commit d112830 into apache:main Apr 10, 2025
95 checks passed
@kaxil kaxil deleted the remove-try_id-from-ti branch April 10, 2025 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:API Airflow's REST/HTTP API full tests needed We need to run full set of tests for this PR to merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Change TI table to have unique UUID id/pk per attempt

3 participants