Skip to content

fix: share duckdb adapter is overlapping data files#2039

Merged
eakmanrq merged 1 commit intomainfrom
eakmanrq/force_single_duckdb_connection
Jan 29, 2024
Merged

fix: share duckdb adapter is overlapping data files#2039
eakmanrq merged 1 commit intomainfrom
eakmanrq/force_single_duckdb_connection

Conversation

@eakmanrq
Copy link
Contributor

Part of fix for: #2037

Result of this change: #1975

Prior to this change we would allow multiple adapters to share a common data file for DuckDB. This actually works fine until multiple adapters are created again pointed to the already created file and then the second adapter (typically state sync) will not read any data. This is why testing before of having multiple adapter run a plan and check the result did not show any issues.

The solution is to check when creating a new adapter for DuckDB if the new adapter is going to point to file that overlaps a file already used by another adapter. If so, we just reuse the past adapter. This has a downside that any additional configuration associated with the new adapter is ignored. One could consider merging the previous and new catalogs together if this overlap is detected but then it doesn't address other config. For example, what if the new one has other connection config set? How do we merge those? I'm wondering if this naive approach will work in most cases to where we can handle the more complex situations later. For example we will eventually want to support Motherduck and that could be a good time to rework things with a more robust use-case in mind.

@eakmanrq eakmanrq force-pushed the eakmanrq/force_single_duckdb_connection branch from 8320190 to 9400be8 Compare January 29, 2024 16:32
@eakmanrq eakmanrq enabled auto-merge (squash) January 29, 2024 16:33
@eakmanrq eakmanrq force-pushed the eakmanrq/force_single_duckdb_connection branch from 9400be8 to ef9e236 Compare January 29, 2024 22:58
@eakmanrq eakmanrq merged commit 9f0b0eb into main Jan 29, 2024
@eakmanrq eakmanrq deleted the eakmanrq/force_single_duckdb_connection branch January 29, 2024 23:06
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