Skip to content

dbt State model concurrency - #9795

Open
luna-bianca wants to merge 6 commits into
currentfrom
dbt-state-model-concurrency
Open

dbt State model concurrency#9795
luna-bianca wants to merge 6 commits into
currentfrom
dbt-state-model-concurrency

Conversation

@luna-bianca

@luna-bianca luna-bianca commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

What are you changing in this pull request and why?

Closes https://dbtlabs.atlassian.net/browse/PRODDOCS-1256

Documents a known gap in dbt State: unlike state-aware orchestration, dbt State doesn't detect when the same model is already being built by another concurrent job. Both jobs run independently, resulting in duplicate compute (though no data corruption). Adds a new "No concurrent build detection" entry to the Known differences section of the migration guide, including the workaround of configuring job schedules or avoiding overlapping manually triggered runs.

Source: https://dbt-labs.slack.com/archives/C0B0L9R47HB/p1786483730719469?thread_ts=1781736611.990089&cid=C0B0L9R47HB

Checklist


🚀 Deployment available! Here are the direct links to the updated files:

@luna-bianca
luna-bianca requested a review from a team as a code owner August 12, 2026 12:43
@vercel

vercel Bot commented Aug 12, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs-getdbt-com Ready Ready Preview Aug 20, 2026 10:14am

Request Review

@github-actions github-actions Bot added the content Improvements or additions to content label Aug 12, 2026
- **`build_after` vs `lag_tolerance`**: Both configs reduce how often a model runs when upstream data is frequently fresh, but they work differently:
- `freshness.build_after` (for example, `{count: 4, period: hour}`) skips the model unless the configured interval has elapsed _and_ upstream sources have new data since the last run. A SQL change alone does not trigger a rebuild; both conditions must be met.
- `state.lag_tolerance` (for example, `4h`) skips the model unless upstream data is newer than the model's last run by at least the configured interval. Unlike `build_after`, a detected SQL change triggers a rebuild.
- **No concurrent build detection**: In state-aware orchestration, if a model was being built by one job, any other job that included the same model would skip it. dbt State doesn't have this mechanism; if two jobs include the same model and run at the same time (for example, an hourly and a daily job that overlap), both jobs build the model independently. This doesn't cause data corruption because the warehouse handles concurrent writes, but it does result in duplicate compute.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This doesn't cause data corruption because the warehouse handles concurrent writes, but it does result in duplicate compute.

This can cause data corruption in snapshots and incremental models if they execute simultaneously on two jobs.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

content Improvements or additions to content

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants