Skip to content

Conversation

@awbush
Copy link
Contributor

@awbush awbush commented Apr 15, 2023

This patch ensures that backfills stop encountering KeyError when popping from running tasks.

  • TaskInstanceKey.reduced is no longer referenced and could be deprecated/removed.
  • Instead, TaskInstance primary key is always used to sync in-memory and DB states.
  • Code comments no longer mention reduced_key and instead use in-memory key.

The issue goes back many years, but these stood out:

Note that scheduler_job_runner.py works around this issue too.


^ 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 newsfragments.

@awbush awbush requested review from XD-DENG, ashb and kaxil as code owners April 15, 2023 02:25
@boring-cyborg boring-cyborg bot added the area:Scheduler including HA (high availability) scheduler label Apr 15, 2023
@boring-cyborg
Copy link

boring-cyborg bot commented Apr 15, 2023

Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst)
Here are some useful points:

  • Pay attention to the quality of your code (ruff, mypy and type annotations). Our pre-commits will help you with that.
  • In case of a new feature add useful documentation (in docstrings or in docs/ directory). Adding a new operator? Check this short guide Consider adding an example DAG that shows how users should use it.
  • Consider using Breeze environment for testing locally, it's a heavy docker but it ships with a working Airflow and a lot of integrations.
  • Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
  • Please follow ASF Code of Conduct for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
  • Be sure to read the Airflow Coding style.
    Apache Airflow is a community-driven project and together we are making it better 🚀.
    In case of doubts contact the developers at:
    Mailing List: dev@airflow.apache.org
    Slack: https://s.apache.org/airflow-slack

@potiuk potiuk requested a review from hussein-awala April 22, 2023 16:13
@potiuk
Copy link
Member

potiuk commented Apr 22, 2023

I believe a better solution is being discussed in #30669 - I think we really need to add a new db entity to handle all problems with try_num. Closing this as essentially duplicate - and I think discussions should happen there.

Copy link
Member

@potiuk potiuk left a comment

Choose a reason for hiding this comment

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

@hussein-awala @ashb @uranusjr -> maybe indeed (see the comment in #30669 (comment)) we could merge that one to 2.6.* to fix the backfill_job try_num calculation before we have a more permanent fix.

Need a second pair of eyes on that one.

@potiuk potiuk added this to the Airflow 2.6.1 milestone Apr 29, 2023
Copy link
Member

@hussein-awala hussein-awala left a comment

Choose a reason for hiding this comment

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

looks good, LGTM

@potiuk potiuk merged commit 17d1f3a into apache:main Apr 29, 2023
@boring-cyborg
Copy link

boring-cyborg bot commented Apr 29, 2023

Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions.

@awbush awbush deleted the fix-backfill-keyerror branch May 2, 2023 20:05
@ephraimbuddy ephraimbuddy added the type:bug-fix Changelog: Bug Fixes label May 8, 2023
ephraimbuddy pushed a commit that referenced this pull request May 8, 2023
Co-authored-by: Anthony Bush <anthony.bush@reddit.com>
(cherry picked from commit 17d1f3a)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:Scheduler including HA (high availability) scheduler type:bug-fix Changelog: Bug Fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants