From 439a7cd9da9f70092ccf47dca49eee356353b986 Mon Sep 17 00:00:00 2001 From: Garry Hill Date: Thu, 9 Nov 2023 11:21:53 +0000 Subject: [PATCH] compensation updates are removed by serialisation --- .../electric/postgres/shadow_table_transformation.ex | 5 ----- .../lib/electric/replication/postgres/slot_server.ex | 10 ---------- 2 files changed, 15 deletions(-) diff --git a/components/electric/lib/electric/postgres/shadow_table_transformation.ex b/components/electric/lib/electric/postgres/shadow_table_transformation.ex index e7586706a4..e552246acd 100644 --- a/components/electric/lib/electric/postgres/shadow_table_transformation.ex +++ b/components/electric/lib/electric/postgres/shadow_table_transformation.ex @@ -98,11 +98,6 @@ defmodule Electric.Postgres.ShadowTableTransformation do defp build_bitmask(%Changes.Compensation{}, columns), do: Enum.map(columns, fn _ -> "f" end) - # TODO: Kept for compatibility with old clients that send a special update for compensation - # messages. remove once we're sure all clients have been updated. - defp build_bitmask(%Changes.UpdatedRecord{old_record: nil}, columns), - do: Enum.map(columns, fn _ -> "f" end) - defp build_bitmask(%Changes.UpdatedRecord{old_record: old, record: new}, columns), do: Enum.map(columns, fn col -> if old[col] != new[col], do: "t", else: "f" end) diff --git a/components/electric/lib/electric/replication/postgres/slot_server.ex b/components/electric/lib/electric/replication/postgres/slot_server.ex index 4fe17d9c7e..e25dfaeab0 100644 --- a/components/electric/lib/electric/replication/postgres/slot_server.ex +++ b/components/electric/lib/electric/replication/postgres/slot_server.ex @@ -465,16 +465,6 @@ defmodule Electric.Replication.Postgres.SlotServer do } end - defp changes_to_wal( - %Changes.UpdatedRecord{relation: table, old_record: nil, record: new}, - relations - ) do - %ReplicationMessages.Update{ - relation_id: relations[table].oid, - tuple_data: record_to_tuple(new, relations[table].columns) - } - end - defp changes_to_wal( %Changes.UpdatedRecord{relation: table, old_record: old, record: new}, relations