4 ms·
> complex retry logic READ COMMITTED and REPEATABLE READ benefit from retry logic as well, not just SERIALIZABLE. For a long time, I sought to write deadlock
by paulddraper 7y ago
> complex retry logic
READ COMMITTED and REPEATABLE READ benefit from retry logic as well, not just SERIALIZABLE.
For a long time, I sought to write deadlock free code.
But that is very hard.
For example in PostgreSQL every UPDATE must be ordered, every DELETE must be ordered. [1]
Finally, I did myself a favor and create application-level retires.
This is 100% cool so long as (1) your deadlocks aren't so frequent so as to reach a performance problem and (2) the action is "replayable" (e.g. no read-once streams). Fortunately, these are both frequently true.
[1] https://dba.stackexchange.com/questions/257587/is-select-for-update-necessary-to-delete-or-update-multiple-rows-without-d https://dba.stackexchange.com/questions/257587/is-select-for...
- taffer 7y agoDo you use SERIALIZABLE in Postgres? If so, what's your experience?