Kunal8954 opened a new pull request, #72788:
URL: https://github.com/apache/airflow/pull/72788

   Clearing a task instance now deletes its `task_state_store` rows, so a 
re-expanded
   dynamically mapped task never inherits the state of the item that previously 
occupied
   the same positional `map_index`.
   
   The state store is keyed by positional `map_index` and previously survived an
   operator-initiated clear. If the expanded upstream list changes between runs 
(an
   insertion, deletion, or reordering), index *N* on the second attempt is a 
different
   item than index *N* on the first, and would silently inherit the earlier 
item's state
   (including a stored external-job reference), while the run still reports 
success.
   
   Airflow's own clear path already regenerates the TaskInstance uuid and 
deletes XComs
   in `clear_task_instances`; this change adds the state store wipe in the same 
place.
   Automatic retries are not clears and still share rows, so durable execution 
continues
   to resume a failed attempt from its last checkpoint. The docs 
(`resumable-tasks.rst`
   and `task-state-store.rst`) are updated to describe clearing as a controlled 
reset and
   to document the positional-index caveat for mapped tasks.
   
   closes: #72725
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes — big-pickle (opencode/big-pickle)
   
   Generated-by: big-pickle (opencode/big-pickle) following [the 
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)


-- 
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]

Reply via email to