hard20 pts · first answer countstransactionspostgresqlconcurrency
Write skew under snapshot isolation
Rule: at least one doctor must stay on call. Two doctors press "go off call" at the same moment. Each transaction runs SELECT count(*) of on-call doctors, sees 2, and updates only its own row. Both commit at REPEATABLE READ in PostgreSQL, leaving zero on call. Which fix works?
Discussion 0
Join free to post in the discussion.
Related questions
- Moving credits between accountsFull Stack Developer
- Two buyers, one item leftFull Stack Developer
- Unique email with soft deletesFull Stack Developer
- Two agents edit one ticketFull Stack Developer
- Payment call inside a transactionFull Stack Developer
- Atomicity in a money transferBackend Developer
- Duplicate emails despite a checkBackend Developer
- What atomicity guaranteesBackend Developer