Skip to content

Commit

Permalink
fix: Remove replication slot teardown from disconnect (#1272)
Browse files Browse the repository at this point in the history
  • Loading branch information
filipecabaco authored Jan 21, 2025
1 parent 998967e commit 5f1c769
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 7 deletions.
5 changes: 0 additions & 5 deletions lib/realtime/tenants/replication_connection.ex
Original file line number Diff line number Diff line change
Expand Up @@ -339,11 +339,6 @@ defmodule Realtime.Tenants.ReplicationConnection do

@impl true
def handle_disconnect(state) do
%{tenant_id: tenant_id, replication_slot_name: replication_slot_name} = state

tenant = Cache.get_tenant_by_external_id(tenant_id)
Database.replication_slot_teardown(tenant, replication_slot_name)

Logger.warning("Disconnecting broadcast changes handler: #{inspect(state, pretty: true)}")
{:noreply, %{state | step: :disconnected}}
end
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ defmodule Realtime.MixProject do
def project do
[
app: :realtime,
version: "2.34.0",
version: "2.34.1",
elixir: "~> 1.17.3",
elixirc_paths: elixirc_paths(Mix.env()),
start_permanent: Mix.env() == :prod,
Expand Down
1 change: 0 additions & 1 deletion test/support/cleanup.ex
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ defmodule Cleanup do

# Stop lingering connections
Enum.each(:ets.tab2list(@table_name), fn {tenant_id, _, _, _, _, _} ->
IO.inspect("Shutting down tenant: #{tenant_id}")
Connect.shutdown(tenant_id)
end)

Expand Down

0 comments on commit 5f1c769

Please sign in to comment.