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

fix: Do not await full setup to configure dropping replication slot #2137

Merged
merged 3 commits into from
Dec 10, 2024

Conversation

msfstef
Copy link
Contributor

@msfstef msfstef commented Dec 10, 2024

Encountered an error in cloud work where the call to configure dropping the replication slot would time out because the connection manager would not become active - since this call only sets a configuration parameter, I think that the connection manager should handle the slot drop internally.

I've unblocked the configuration call, and made it so that it just logs a warning if a connection pool is not available to drop the slot.

Copy link
Contributor

@robacourt robacourt left a comment

Choose a reason for hiding this comment

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

LGTM. This may mean orphaned slots get left on the database, but I guess that's better than the call timing out. Eventually we'll need a more resilient way of removing slots.

@@ -134,7 +134,6 @@ defmodule Electric.Connection.Manager do
end

def drop_replication_slot_on_stop(server) do
await_active(server)
Copy link
Contributor

Choose a reason for hiding this comment

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

If you're not calling await_active here, I imagine you're going to need to call await_active in this test in stratovolt to get it to pass.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not really because the setup of the test ensures that the stack is :ready - that encapsulates awaiting for the connection manager to be ready

@msfstef
Copy link
Contributor Author

msfstef commented Dec 10, 2024

This may mean orphaned slots get left on the database

Currently that's a concern in many cases where the shut down doesn't go as planned, so we need a cleanup procedure anyway independent of Electric. But yeah currently it times out if for example it's waiting for the lock connection - no reason to time out that call as that is not the intent of the call.

@msfstef msfstef merged commit 309ac75 into main Dec 10, 2024
31 checks passed
@msfstef msfstef deleted the msfstef/do-not-await-for-drop-config branch December 10, 2024 12:08
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