A lost update overwrites an earlier write derived from a stale read.

highlighted = computed this step

Lost update

A lost update occurs when two transactions read the same item and both write a new value. The later write overwrites the earlier write. Note: the render shows the final value chosen by the trace.

lost update\text{lost update}

Both transactions read

The compiled trace has 2 reads before the writes finish. Note: both reads are the base for later writes.

reads=2\text{reads}=2

these traces model specific anomalies under a read-latest-write execution model; isolation levels (RC/RR/SI/serializable) and MVCC mechanism are modelled later - no product claims.

Lost update T1 T2 0 R(X)=100 1 R(X)=100 2 W(X,110) 3 W(X,120) anomaly: lost_update final: X=120 serial: X=120

Overwrite

The lost write value is 110 and the final state has 1 item. Note: the final value appears in the render, not in prose.

lost value=110,final items=1\text{lost value}=110,\quad \text{final items}=1

these traces model specific anomalies under a read-latest-write execution model; isolation levels (RC/RR/SI/serializable) and MVCC mechanism are modelled later - no product claims.

Lost update T1 T2 0 R(X)=100 1 R(X)=100 2 W(X,110) 3 W(X,120) anomaly: lost_update final: X=120 serial: X=120

Summary

Lost update is an overwrite anomaly caused by interleaved read-modify-write work. Note: isolation levels, serializable behavior, and MVCC mechanisms are deferred to later books.

overwrite anomaly\text{overwrite anomaly}