pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Avoid update conflict out serialization anomalies.
7+ messages / 1 participants
[nested] [flat]

* pgsql: Avoid update conflict out serialization anomalies.
@ 2020-06-11 17:11 Peter Geoghegan <pg@bowt.ie>
  0 siblings, 0 replies; 7+ messages in thread

From: Peter Geoghegan @ 2020-06-11 17:11 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: Avoid update conflict out serialization anomalies.
@ 2020-06-11 17:11 Peter Geoghegan <pg@bowt.ie>
  0 siblings, 0 replies; 7+ messages in thread

From: Peter Geoghegan @ 2020-06-11 17:11 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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
------
REL_13_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/6df7105e5d50460623421d00f24aaa46b66fa570

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(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: Avoid update conflict out serialization anomalies.
@ 2020-06-11 17:11 Peter Geoghegan <pg@bowt.ie>
  0 siblings, 0 replies; 7+ messages in thread

From: Peter Geoghegan @ 2020-06-11 17:11 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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
------
REL_12_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/e620a38c23b9f7338d93ffd4c51bacc31973ac35

Modified Files
--------------
src/backend/storage/lmgr/predicate.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(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: Avoid update conflict out serialization anomalies.
@ 2020-06-11 17:11 Peter Geoghegan <pg@bowt.ie>
  0 siblings, 0 replies; 7+ messages in thread

From: Peter Geoghegan @ 2020-06-11 17:11 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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
------
REL_11_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/dd616f2ec1c517da4e6de2801f6386d01d098840

Modified Files
--------------
src/backend/storage/lmgr/predicate.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(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: Avoid update conflict out serialization anomalies.
@ 2020-06-11 17:11 Peter Geoghegan <pg@bowt.ie>
  0 siblings, 0 replies; 7+ messages in thread

From: Peter Geoghegan @ 2020-06-11 17:11 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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
------
REL_10_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/19a6e1bc30832dbfadc4e4ae2b29bbc756ce65a9

Modified Files
--------------
src/backend/storage/lmgr/predicate.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(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: Avoid update conflict out serialization anomalies.
@ 2020-06-11 17:11 Peter Geoghegan <pg@bowt.ie>
  0 siblings, 0 replies; 7+ messages in thread

From: Peter Geoghegan @ 2020-06-11 17:11 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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
------
REL9_6_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/e81dc2b7e2c49fa2bb647ce562a8fd3cbbf51e0b

Modified Files
--------------
src/backend/storage/lmgr/predicate.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(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: Avoid update conflict out serialization anomalies.
@ 2020-06-11 17:11 Peter Geoghegan <pg@bowt.ie>
  0 siblings, 0 replies; 7+ messages in thread

From: Peter Geoghegan @ 2020-06-11 17:11 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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
------
REL9_5_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/c05f6b354ffe04550f41f7e36091a80b571258ee

Modified Files
--------------
src/backend/storage/lmgr/predicate.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(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread


end of thread, other threads:[~2020-06-11 17:11 UTC | newest]

Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-06-11 17:11 pgsql: Avoid update conflict out serialization anomalies. Peter Geoghegan <pg@bowt.ie>
2020-06-11 17:11 pgsql: Avoid update conflict out serialization anomalies. Peter Geoghegan <pg@bowt.ie>
2020-06-11 17:11 pgsql: Avoid update conflict out serialization anomalies. Peter Geoghegan <pg@bowt.ie>
2020-06-11 17:11 pgsql: Avoid update conflict out serialization anomalies. Peter Geoghegan <pg@bowt.ie>
2020-06-11 17:11 pgsql: Avoid update conflict out serialization anomalies. Peter Geoghegan <pg@bowt.ie>
2020-06-11 17:11 pgsql: Avoid update conflict out serialization anomalies. Peter Geoghegan <pg@bowt.ie>
2020-06-11 17:11 pgsql: Avoid update conflict out serialization anomalies. Peter Geoghegan <pg@bowt.ie>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox