JEPSEN

P0 (Dirty Write)

Phenomenon P0, or Dirty Write, occurs when one transaction writes over another transaction before that transaction has completed. Specifically, transaction Ti writes some version xi, and a different transaction Tj writes the next version of x. Then both transactions go on to commit, or abort, in any order.

P0 was developed for databases with a totally ordered view of time. In a distributed system, this order may not meaningfully exist.

Formally

Berenson et al defined P0 in their Snapshot Isolation paper:

A dirty write occurs when transaction T1 writes x, then T2 writes x prior to T1’s abort or commit:

  • P0: w1[x] … w2[x] … ((c1 or a1) and (c2 or a2) in any order)

See Also

Adya’s G0 (Write Cycle) generalizes the concept of write isolation to any number of transactions whose writes interfere with each other. G0 is also more precise: proscribing P0 rules out some Serializable histories, whereas proscribing G0 does not.