fix(google): use run_id instead of logical_date in StackdriverRemoteLogIO.read() filter#68249
Open
goingforstudying-ctrl wants to merge 1 commit into
Open
Conversation
c5ac20b to
07ba3ad
Compare
…ogIO.read() filter In AF3's supervisor model the REMOTE_TASK_LOG handler runs in the supervisor process, which has no DB connection to convert run_id to logical_date. The read path now filters on run_id directly, consistent with the write path that already emits run_id as a label (Bug 1). relates to apache#68240
07ba3ad to
fa203ef
Compare
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.
Fixes Bug 2 from #68240.
What
StackdriverRemoteLogIO.read()currently builds its Cloud Logging filter from_task_instance_to_labels(), which includeslogical_date. In Airflow 3'ssupervisor model the
REMOTE_TASK_LOGhandler runs in the supervisor process,which has no DB connection to convert
run_id→logical_date. The filtereither crashes or returns no results.
Fix
read()now constructs the filter labels directly usingrun_idinstead oflogical_date. This matches the write path (Bug 1 / #68246) which alreadyemits
run_idas a label extracted from the log path.The
_task_instance_to_labels()helper (used by the webserver-sideStackdriverTaskHandler) is left unchanged to avoid breaking log reads forexisting deployments that have
logical_datelabels.Changes
LABEL_RUN_IDconstantStackdriverRemoteLogIO.read()builds filter from{dag_id, task_id, run_id, try_number}— nological_datetest_read_logs/test_read_logs_emptytest_read_logs_uses_run_id_filterverifies run_id in filter and absence of logical_daterelates to #68240