2 Commits
Author SHA1 Message Date
DarkChromaandClaude Opus 5.5 dffa04fc4c Recover DuckDB entity UUID conflicts without dropping or stalling (#1039)
A DuckDB unique-index conflict on co_entity_spawn.uuid can happen when the
identity row was committed after the consumer transaction's snapshot began
(or a delete is still visible to an older reader).

- Entity removals: on the exact duplicate-UUID constraint error, roll back,
  start a fresh transaction and retry once; reuse the identity that is now
  visible. If it is still unresolved, drop only that removal and continue,
  instead of retrying the same event forever and blocking the queue.
- Entity interactions: same refresh-and-retry, loading the existing identity
  so the interaction is recorded instead of dropped (#1002 only dropped it).
- Match the conflict on the event's own UUID, so other constraint errors are
  still retried and reported.
- Reopen the entity_spawn prepared statement when DuckDB closed it after a
  constraint violation.
- Summarize skipped records in one console warning every 5 minutes instead of
  a stack trace per event.

Refs #998

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 12:10:24 -06:00
DarkChroma 0ec76561dc Prevent DuckDB entity interaction queue stalls (#1002) 2026-09-19 12:37:10 -06:00