pgsql: Fix bug in following update chain when locking a heap tuple

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема pgsql: Fix bug in following update chain when locking a heap tuple
Дата
Msg-id E1vY1Aq-002FRQ-2c@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Fix bug in following update chain when locking a heap tuple

After waiting for a concurrent updater to finish, heap_lock_tuple()
followed the update chain to lock all tuple versions. However, when
stepping from the initial tuple to the next one, it failed to check
that the next tuple's XMIN matches the initial tuple's XMAX. That's an
important check whenever following an update chain, and the recursive
part that follows the chain did it, but the initial step missed it.
Without the check, if the updating transaction aborts, the updated
tuple is vacuumed away and replaced by an unrelated tuple, the
unrelated tuple might get incorrectly locked.

Author: Jasper Smit <jasper.smit@servicenow.com>
Discussion: https://www.postgresql.org/message-id/CAOG+RQ74x0q=kgBBQ=mezuvOeZBfSxM1qu_o0V28bwDz3dHxLw@mail.gmail.com
Backpatch-through: 14

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/5d5487cd256f1865f6364a7e787eb5fcde6ae1b9

Modified Files
--------------
src/backend/access/heap/heapam.c | 46 +++++++++++++++++++++++++++-------------
1 file changed, 31 insertions(+), 15 deletions(-)


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