Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure prior batch successes are propagated in RunResults during multiple dbt retry scenarios #10800

Closed
Tracked by #10624
QMalcolm opened this issue Sep 30, 2024 · 0 comments · Fixed by #10802
Closed
Tracked by #10624
Assignees
Milestone

Comments

@QMalcolm
Copy link
Contributor

QMalcolm commented Sep 30, 2024

In a6a1ef8 of #10751 we added some edge case handling logic such that if every batch for a microbatch model failed, the batches would be regenerated on retry and true/false on full-refresh would be properly applied. This was to address the following edge case:

  1. a microbatch model had a begin of 2020-01-01 and has been running this way for a while
  2. the begin config has changed to 2024-01-01 and dbt run --full-refresh gets run
  3. every batch for a microbatch model fails
  4. on dbt retry the relation for the model is said to exist, and the now out of range data (2020-01-01 through 2023-12-31) is never purged

The solution in a6a1ef8 did solve this edge case, however it also created another:

  1. On dbt run a microbatch model has 2 batches that succeed and 1 batch that fails
  2. On the first invocation of dbt retry the 1 previously failed batch is retried and fails again
  3. dbt retry is run a second time and now 3 batches are run (the initial two that succeeded, and the failing one)

At step (3) only the failing batch should be run. However, presently our logic is that if a prior run has only failed batches, then we rerun the microbatch model as it did on dbt run. We need on the second retry to know that we had previously successful batches for the initial run being retried. However, we also must continue to solve the edge case we resolved in a6a1ef8.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant