From 9209cd63f0294f2fc207d7353a83ad5001c87d11 Mon Sep 17 00:00:00 2001 From: Oleksii Sholik Date: Thu, 23 Nov 2023 16:50:00 +0200 Subject: [PATCH] fix(electric): Preload internal schema in SchemaCache before looking up an internal relation (#693) As a reminder, we have to have this internal schema in order for Electric to be able to send writes to `electric.acknowledged_client_lsn` over the Electric->PG logical replication connection. --- .../electric/lib/electric/postgres/extension/schema_cache.ex | 1 + 1 file changed, 1 insertion(+) diff --git a/components/electric/lib/electric/postgres/extension/schema_cache.ex b/components/electric/lib/electric/postgres/extension/schema_cache.ex index 827ade3848..c5a3ac402f 100644 --- a/components/electric/lib/electric/postgres/extension/schema_cache.ex +++ b/components/electric/lib/electric/postgres/extension/schema_cache.ex @@ -379,6 +379,7 @@ defmodule Electric.Postgres.Extension.SchemaCache do end def handle_call({:internal_relation, relation}, _from, state) do + state = load_internal_schema(state) {:reply, Schema.table_info(state.internal_schema, relation), state} end