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

Don't sync MotherDuck metadata forever #582

Merged
merged 6 commits into from
Feb 11, 2025
Merged

Conversation

JelteF
Copy link
Collaborator

@JelteF JelteF commented Feb 7, 2025

Keeping a connection open to MotherDuck forever is undesirable from a resourcing perspective. This changes that to behave similarly to the DuckDB CLI: After 5 minutes (by default) syncing will stop. The main difficulty is to restart the syncing. In the DuckDB CLI the syncing will start again after some activity is detected, but the background worker never triggers activity. So instead we need to make sure that activity in other connections triggers a restart of the syncing in the background worker. This is done using some very simple IPC in shared memory.

@JelteF JelteF force-pushed the dont-always-sync-motherduck branch 5 times, most recently from 2fccd22 to 40b2674 Compare February 7, 2025 14:26
Keeping a connection open to MotherDuck forever is undesirable from a
resourcing perspective on the MotherDuck side. This changes that to
behave similarly like the DuckDB CLI, after 5 minutes (by default)
syncing will stop. The main difficulty is to restart the syncing.
In the DuckDB CLI the syncing will start again after some activity is
detected, but the background worker never triggers activity. So instead
we need to make sure that activity in other connections triggers a
restart of the syncing in the background worker. This is done using some
very simple IPC in shared memory.
@JelteF JelteF force-pushed the dont-always-sync-motherduck branch from 40b2674 to 892f6c7 Compare February 7, 2025 14:26
Comment on lines +662 to +664
* TODO: Passing a reference through InvokeCPPFunc doesn't work here
* for some reason. So to work around that we use a pointer instead.
* We should fix the underlying problem instead.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@Y-- maybe something for your template magic to fix.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think I've seen something like that in the past. Never got a chance to investigate though... Let's open an issue and I'll try to look at it soon?

Copy link
Collaborator

@Y-- Y-- left a comment

Choose a reason for hiding this comment

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

LGTM, main comment is around timeout default

@JelteF JelteF enabled auto-merge (squash) February 11, 2025 14:08
@JelteF JelteF merged commit 236e5c1 into main Feb 11, 2025
5 checks passed
@JelteF JelteF deleted the dont-always-sync-motherduck branch February 11, 2025 14:17
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