Operator extra links per attempt (draft A): a row per attempt in XCom - #71518
Closed
1fanwang wants to merge 2 commits into
Closed
Operator extra links per attempt (draft A): a row per attempt in XCom#715181fanwang wants to merge 2 commits into
1fanwang wants to merge 2 commits into
Conversation
Operator extra links are cached as XCom rows under the link's xcom_key, which carries no attempt. XComOperatorLink.get_link receives a TaskInstanceKey and ignores its try_number, so once a task retries, asking for an earlier attempt's link returns the latest attempt's URL. apache#65661 made the endpoint resolve the requested attempt, which makes the wrong answer reachable from the UI. The worker now also caches the link under a key carrying the attempt that produced it, and the reader prefers that row, falling back to the bare key for links written before this change. Those rows are exempt from the clear a retry issues, since they describe attempts that already ran. The prefix is owned by Airflow rather than derived from the link's xcom_key, because a link may override that with any name, as the Databricks and Google links do. Closes: apache#71471 Signed-off-by: 1fanwang <1fannnw@gmail.com>
1fanwang
requested review from
amoghrajesh,
ashb,
bolkedebruin and
kaxil
as code owners
August 12, 2026 20:49
This was referenced Aug 12, 2026
1fanwang
marked this pull request as draft
August 12, 2026 23:42
Signed-off-by: 1fanwang <1fannnw@gmail.com>
Contributor
Author
|
Going with #71522 instead: the task state store is where cross-retry state already lives, so the XCom clear stays absolute rather than gaining an exemption. Closing this one. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TL;DR — operator extra links don't work per attempt (#71471). After a retry the button
under attempt 1 opens attempt 2's logs. It hits every bundled provider linking to per-attempt
logs: EMR, Glue, Databricks, Dataproc, Livy.
Draft A of three for the same bug — pick a shape and I'll finish it and close the others.
Recommended: C (#71522). See the issue for why; A is the fallback if this needs to ship on the 3.2 line.
How
The worker already caches each rendered link as an XCom row under the link's
xcom_key. Itnow also writes one under a key carrying the attempt, the reader prefers that row and falls
back to the bare key, and those rows survive the clear a retry issues.
The prefix is owned by Airflow rather than derived from
xcom_key, because a link mayoverride that with any name — Databricks uses
databricks_job_run_link,BaseGoogleLinkproxies to
self.key.Testing
Red to green on a real metastore, rows present for both attempts.
Raw output
Before, on 3.2.2 — attempt 1 resolves to attempt 2's URL:
After:
Purge predicate, including keys that would be spared if the
_were left as a LIKE wildcard:Tests cover the reader preferring the requested attempt, the fallback, and the run endpoint
keeping those rows out of
xcom_keys_to_clear. The full suite runs in CI.