Write Skew — Two Doctors, Zero On Call

Write Skew — Two Doctors, Zero On Call A sequence diagram generated by Archify. SELECT doctors on call for shift 1234 read from the snapshot 2 doctors on call — premise holds SELECT doctors on call for shift 1234 same premise from its own snapshot 2 doctors on call — premise holds UPDATE Aaliyah set on_call = false UPDATE Bryce set on_call = false COMMIT locks only Aaliyah's row COMMIT no conflict detected here 0 doctors on call write skew — only serializable isolation stops it Both read the premise Both act on the premise Both commit — the invariant breaks Tx: Aaliyah · gives up her shift · Sequence participant Tx: Aaliyah gives up her shift Tx: Bryce · gives up his shift · Sequence participant Tx: Bryce gives up his shift Database · snapshot isolation · Sequence participant Database snapshot isolation Invariant · at least one on call · Sequence participant Invariant at least one on call Legend main request return async trace message