Skip to content

Commit

Permalink
compensation updates are removed by serialisation
Browse files Browse the repository at this point in the history
  • Loading branch information
magnetised committed Nov 9, 2023
1 parent 6231e64 commit 6216733
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6216733

Please sign in to comment.