diff --git a/python_modules/dagster/dagster/_core/execution/asset_backfill.py b/python_modules/dagster/dagster/_core/execution/asset_backfill.py index 6fdaa6e19afba..9137381255d3a 100644 --- a/python_modules/dagster/dagster/_core/execution/asset_backfill.py +++ b/python_modules/dagster/dagster/_core/execution/asset_backfill.py @@ -1284,12 +1284,19 @@ def get_canceling_asset_backfill_iteration_data( ), asset_graph, ) + # we fetch the failed_subset to get any new assets that have failed and add that to the set of + # assets we alerady know failed and their downstreams. However we need to remove any assets in + # updated_materialized_subset to account for the case where a run retry successfully + # materialized a previlusly failed asset. + updated_failed_subset = ( + asset_backfill_data.failed_and_downstream_subset | failed_subset + ) - updated_materialized_subset updated_backfill_data = AssetBackfillData( target_subset=asset_backfill_data.target_subset, latest_storage_id=asset_backfill_data.latest_storage_id, requested_runs_for_target_roots=asset_backfill_data.requested_runs_for_target_roots, materialized_subset=updated_materialized_subset, - failed_and_downstream_subset=failed_subset, + failed_and_downstream_subset=updated_failed_subset, requested_subset=asset_backfill_data.requested_subset, backfill_start_time=TimestampWithTimezone(backfill_start_timestamp, "UTC"), )