Skip to content

Conversation

@pavel-lexyr
Copy link
Contributor

This PR aims to fix a long-standing logging bug present in Airflow. In particular, any clusters of more than one worker do not handle their logs appropriately - always fetching files from the host used in the last run.

This change adds a lookup table for per-try information for TaskInstances. That allows storing a separate hostname for each try of a task.

Questions to consider before merging - comments would be appreciated:

  • What kinds of tests should be added?
  • What is the appropriate way to add a database migration to the codebase?

This is a redesign of a previous PR #23135.

closes: #16472

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The primary key should be TaskInstance’s primary key + try_number.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should there also be a map_index in this table?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. Added map_index to the PK, that should make the full TaskInstance key.

@ashb ashb added this to the Airflow 2.4.0 milestone Apr 25, 2022
@ashb
Copy link
Member

ashb commented Apr 25, 2022

Idle thought: Do we need this table and TaskFail table, or could a single table serve both purposes?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shouldn't have this duplicated here.

Copy link
Contributor Author

@pavel-lexyr pavel-lexyr Apr 25, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed. Good catch!

@uranusjr
Copy link
Member

Do we need this table and TaskFail table, or could a single table serve both purposes?

We can probably merge them, but it’ll need some work, I have difficulties keeping track of try_number increments and TaskFail insertions in my head…

@pavel-lexyr pavel-lexyr requested review from ashb and uranusjr April 25, 2022 21:47
@pavel-lexyr pavel-lexyr force-pushed the hostname-lookup-table branch 2 times, most recently from 95734cf to 18cf8f9 Compare May 3, 2022 20:38
@github-actions
Copy link

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 5 days if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale Stale PRs per the .github/workflows/stale.yml policy file label Jun 18, 2022
@potiuk potiuk force-pushed the hostname-lookup-table branch from 18cf8f9 to 1cf7f85 Compare June 19, 2022 22:52
@eladkal eladkal removed the stale Stale PRs per the .github/workflows/stale.yml policy file label Jun 20, 2022
@github-actions
Copy link

github-actions bot commented Aug 5, 2022

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 5 days if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale Stale PRs per the .github/workflows/stale.yml policy file label Aug 5, 2022
@github-actions github-actions bot closed this Aug 11, 2022
@ashb ashb removed this from the Airflow 2.4.0 milestone Sep 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:logging dont-merge stale Stale PRs per the .github/workflows/stale.yml policy file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Failed to fetch log file from worker because webserver did not search the right worker.

5 participants