fix assets with the same backfill policy not being materialized together #21880
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.
Summary & Motivation
A user reported an issue where a backfill requested a parent and child asset partitions in separate runs, causing the child asset partition to fail since the parent had not yet been materialized. After some investigation, it looks like if multiple assets have the same partitions definition, different backfill policies, and were going to be requested in one tick of the backfill daemon, we requested each asset individually instead of grouping by backfill policy. This causes parent-child asset pairs that were going to be materialized together by that tick to be requested in different runs.
This PR changes the behavior so that we group by backfill policy. I think this change should be ok because we already know the assets have the same partitions def and requested partitions, and we know that any parent/child assets must have the same backfill definition from the
can_run_with_parent
check earlier in the daemon loopHow I Tested These Changes
new unit test. It failed before making the code changed (there were 3 run requests instead of 2) and passes now