-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[CT-1161] snapshot tables are being recreated from scratch #5824
Comments
Thanks for opening @deugene ! We expect only one dbt invocation at a time (for a given set of database objects). Are you intentionally triggering multiple concurrent dbt snapshots? If so, could you tell me more about the use case why? |
Hi, @dbeatty10! Thanks for the answer. We have partitioned jobs that extract and load data hourly, daily, weekly, etc. After each job we run corresponding dbt models (we achieved this by adding tags hourly, daily, weekly, etc. to models) but in some cases daily and hourly models may have refs to the same model/snapshot, and when we run |
Thanks for describing your use-case @deugene -- I think I understand it from high level. The key to resolving this for you will be to avoid concurrent dbt materializations. The most direct way to achieve this is by having only a single invocation of dbt at a time. Assuming you have tags for While that is running, you would want to make sure to not do the following: The crucial insight is to only do one I'm closing this for now since we intentionally don't support concurrent dbt builds. If I missed an important piece about this issue, we can re-open it. If you want to discuss the merits of concurrent dbt runs, then I'd suggest opening a discussion. |
Is this a new bug in dbt-core?
Current Behavior
Hi! Recently we discovered a problem with dbt snapshots. We use dbt-core v1.2.1 and databricks as storage and from time to time, some of our snapshot tables are being recreated from scratch for no obvious reason. We checked data schemas - columns and their data types haven't changed. After some research, we discovered that there were two concurrent runs exactly at the time when tables were recreated. One of the runs finished successfully (presumably the one which recreated the tables):
And the other one failed with the error:
Expected Behavior
update snapshot tables without recreation.
Steps To Reproduce
Concurrently run the same snapshots with dbt-core v1.2.1 and databricks as a database
Relevant log output
No response
Environment
Which database adapter are you using with dbt?
other (mention it in "Additional Context")
Additional Context
we use the latest dbt-databricks adapter
The text was updated successfully, but these errors were encountered: