Skip to content

Commit 80bd892

Browse files
committed
Log on concurrent remove
1 parent 742b73c commit 80bd892

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

packages/sync-service/lib/electric/shape_cache/shape_status.ex

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,18 @@ defmodule Electric.ShapeCache.ShapeStatus do
174174
|> list_shapes()
175175
|> Enum.flat_map(fn {handle, shape} ->
176176
case id_for_handle(stack_id, handle) do
177-
{:ok, id} -> [{handle, id, shape}]
178-
:error -> []
177+
{:ok, id} ->
178+
[{handle, id, shape}]
179+
180+
:error ->
181+
# populate_shape_meta_table/2 mints/reuses an id for every current
182+
# shape, so this is only reachable if the shape was removed between
183+
# list_shapes/1 and this lookup. Log it so that race is visible.
184+
Logger.warning("Skipping shape with no id mapping (concurrently removed?)",
185+
shape_handle: handle
186+
)
187+
188+
[]
179189
end
180190
end)
181191
end

0 commit comments

Comments
 (0)