r/Supabase • • 17h ago

database PostgreSQL persistent task queue: concurrency, idempotency and restart recovery

/r/codereview/comments/1y6b5t7/postgresql_persistent_task_queue_concurrency/

For those using Supabase, would you recommend Supabase Queues (pgmq) or a dedicated PostgreSQL queue table for this use case? I'm particularly interested in concurrency, stale worker protection and reliable restart recovery.

1 Upvotes

10 comments sorted by

View all comments

1

u/Neat_Act_9199 14h ago

Stale result landing on a fresh row for the same candidate is fixed by putting the claim id in the where clause of your final update, that part isn't really a design question. Did you actually see it happen during testing or is "we identified a potential issue" just you reasoning about the code? Because those need very different amounts of work.

1

u/fervent7 9h ago

Thank you. A stale queue-completion issue was reproduced during offline CI testing, although I am still reviewing the exact failure sequence before drawing a definitive conclusion.

We intend to verify that an outdated claim cannot update a reassigned candidate and that a rejected completion cannot create duplicate observations or downstream events.

I appreciate your point about distinguishing an observed regression from a theoretical concurrency issue.