pgsql: Avoid update conflict out serialization anomalies.

Поиск
Список
Период
Сортировка
От Peter Geoghegan
Тема pgsql: Avoid update conflict out serialization anomalies.
Дата
Msg-id E1jjQjL-00011U-1V@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Avoid update conflict out serialization anomalies.

SSI's HeapCheckForSerializableConflictOut() test failed to correctly
handle conditions involving a concurrently inserted tuple which is later
concurrently updated by a separate transaction .  A SELECT statement
that called HeapCheckForSerializableConflictOut() could end up using the
same XID (updater's XID) for both the original tuple, and the successor
tuple, missing the XID of the xact that created the original tuple
entirely.  This only happened when neither tuple from the chain was
visible to the transaction's MVCC snapshot.

The observable symptoms of this bug were subtle.  A pair of transactions
could commit, with the later transaction failing to observe the effects
of the earlier transaction (because of the confusion created by the
update to the non-visible row).  This bug dates all the way back to
commit dafaa3ef, which added SSI.

To fix, make sure that we check the xmin of concurrently inserted tuples
that happen to also have been updated concurrently.

Author: Peter Geoghegan
Reported-By: Kyle Kingsbury
Reviewed-By: Thomas Munro
Discussion: https://postgr.es/m/db7b729d-0226-d162-a126-8a8ab2dc4443@jepsen.io
Backpatch: All supported versions

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/5940ffb221316ab73e6fdc780dfe9a07d4221ebb

Modified Files
--------------
src/backend/access/heap/heapam.c                   | 21 +++++++--
.../isolation/expected/update-conflict-out.out     | 27 +++++++++++
src/test/isolation/isolation_schedule              |  1 +
src/test/isolation/specs/update-conflict-out.spec  | 54 ++++++++++++++++++++++
4 files changed, 98 insertions(+), 5 deletions(-)


В списке pgsql-committers по дате отправления:

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: pgsql: pg_dump: Remove dead code
Следующее
От: Jeff Davis
Дата:
Сообщение: pgsql: Rework HashAgg GUCs.