Lost update
Definition
A lost update occurs when concurrent read-modify-write cycles on the same data interleave, so one change is overwritten without anyone noticing.
In practice
It is the most common concurrency bug in application code: counters, balances, stock levels and edited documents all suffer from it under READ COMMITTED, the default in Postgres. It also appears outside databases, for example when two workers holding an expired lock both write to storage.
Fixes include atomic updates (SET stock = stock - 1), locking reads with SELECT ... FOR UPDATE, compare-and-set with a version column, snapshot isolation, and fencing tokens for distributed locks. Locks cap a hot row at roughly one update per lock hold time, so a very hot counter may need to be split or batched.
Example
Two requests read stock = 10 and both write stock = 9; two items were sold but only one was subtracted.