Skip to content

Reduce DuckLake table materialization conflicts#710

Open
leonardovida wants to merge 1 commit intoduckdb:masterfrom
leonardovida:fix/ducklake-concurrency-retries
Open

Reduce DuckLake table materialization conflicts#710
leonardovida wants to merge 1 commit intoduckdb:masterfrom
leonardovida:fix/ducklake-concurrency-retries

Conversation

@leonardovida
Copy link

@leonardovida leonardovida commented Mar 24, 2026

We found that the real concurrency issue is dbt persist_docs on DuckLake, specifically the COMMENT ON TABLE / COMMENT ON COLUMN path under concurrent model builds.

Concurrent CTAS alone was fine, and CTAS+rename was also fine, but conflicts appeared when comments were part of the same write flow. I simplified the fix that I originally posted by keeping DuckLake retries for transient TransactionExceptions and deferring persist_docs until after commit.

Initially I created a PR that was explicitly retrying on failures, now this PR is solely focusing on persist_docs

@leonardovida leonardovida force-pushed the fix/ducklake-concurrency-retries branch from 555e4b7 to a700b22 Compare March 24, 2026 21:32
@leonardovida leonardovida force-pushed the fix/ducklake-concurrency-retries branch from a700b22 to 4b96695 Compare March 24, 2026 21:39
@jwills
Copy link
Collaborator

jwills commented Mar 25, 2026

so the fix is to hack the persist_docs operation for Ducklake tables to occur outside of the main transaction?

@leonardovida
Copy link
Author

so the fix is to hack the persist_docs operation for Ducklake tables to occur outside of the main transaction?

We are working on the "real" fix, that will happen on the DuckLake side. In the meantime this might be a possible approach, though it assumes customers do not relay on the invariant of comments being in the same transactions as the CTAS (so possibly having the CTAS go through but not the comment part). What is your stance on this @jwills ?

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 this pull request may close these issues.

2 participants