Files
probo/pkg
Émile Ré a4cc82441a Fix deadlock in concurrent tracker mapping
The tracker-mapping worker runs many Process calls in parallel. In
Phase 4 a single transaction locked the worker's own claimed pattern
row via UpdateMapping and then locked sibling rows on the same banner
via the re-enqueue. Two workers mapping sibling patterns on one banner
each held their own row and waited on the other's, forming a lock cycle
that Postgres aborted with deadlock detected (40P01).

Split the sibling re-enqueue into its own short transaction that runs
after the mapping commits, so the claimed-row lock is released before
any sibling row is locked. Also take the sibling UPDATE row locks in a
deterministic id order through an ORDER BY id ... FOR UPDATE subquery,
so overlapping re-enqueues can no longer invert lock order between
themselves. The re-enqueue only flags siblings, so deferring it past
the commit is safe and lets reprocessed siblings observe committed data.

Signed-off-by: Émile Ré <emile@probo.com>
2026-06-19 10:46:44 +02:00
..
2026-06-15 19:18:42 +02:00
2026-06-16 14:35:16 +02:00
2026-06-16 14:35:16 +02:00
2026-06-16 14:35:16 +02:00
2026-06-16 14:35:16 +02:00
2026-06-16 14:35:16 +02:00
2026-06-12 14:39:51 +02:00