I think I see the difference. In my solution, the id I was passing to pg_try_advisory_lock was the id of the record that was being processed, which would allow several threads to acquire jobs in parallel. The second…
> What did you do to avoid implicit locking, and what sort of isolation level were you using? I avoided implicit locking by manually handling transactions. The query that acquired the lock was a separate transaction…
Not the author, but I've used PG like this in the past. My criteria for selecting a job was (1) the job was not locked and (2) was not in a terminal state. If a job was in the "processing" state and the worker died,…
I've done something like this and opted to use advisory locks instead of row locks thinking that I'd increase performance by avoiding an actual lock. I'm curious to hear what the team thinks the pros/cons of a row vs…
I think I see the difference. In my solution, the id I was passing to pg_try_advisory_lock was the id of the record that was being processed, which would allow several threads to acquire jobs in parallel. The second…
> What did you do to avoid implicit locking, and what sort of isolation level were you using? I avoided implicit locking by manually handling transactions. The query that acquired the lock was a separate transaction…
Not the author, but I've used PG like this in the past. My criteria for selecting a job was (1) the job was not locked and (2) was not in a terminal state. If a job was in the "processing" state and the worker died,…
I've done something like this and opted to use advisory locks instead of row locks thinking that I'd increase performance by avoiding an actual lock. I'm curious to hear what the team thinks the pros/cons of a row vs…