From 35c3baa520bcbc3fa4a7f77067db18fd79e876b9 Mon Sep 17 00:00:00 2001 From: Oleksii Sholik Date: Fri, 3 May 2024 16:51:02 +0300 Subject: [PATCH] Refer readers to a GH issue for "slot already in use" errors --- .../replication/postgres_connector.ex | 26 ++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/components/electric/lib/electric/replication/postgres_connector.ex b/components/electric/lib/electric/replication/postgres_connector.ex index ad39d830bc..4356332cab 100644 --- a/components/electric/lib/electric/replication/postgres_connector.ex +++ b/components/electric/lib/electric/replication/postgres_connector.ex @@ -100,7 +100,31 @@ defmodule Electric.Replication.PostgresConnector do Failed to establish replication connection to Postgres: #{msg} """, - "Another instance of Electric appears to be connected to this database." + """ + Another instance of Electric appears to be connected to this database. + Refer to https://github.com/electric-sql/electric/issues/971 for additional info. + """ + ) + end + + defp log_child_error( + LogicalReplicationProducer, + {:bad_return_value, + {:error, + {:error, :error, "42710", :duplicate_object, "replication slot " <> _ = msg, + _c_stacktrace}}}, + _connector_config + ) do + Electric.Errors.print_error( + :conn, + """ + Failed to establish replication connection to Postgres: + #{msg} + """, + """ + Another instance of Electric appears to be connected to this database. + Refer to https://github.com/electric-sql/electric/issues/971 for additional info. + """ ) end