pgsql: Fix possible Assert failure in verify_compact_attribute() - Mailing list pgsql-committers

From David Rowley
Subject pgsql: Fix possible Assert failure in verify_compact_attribute()
Date
Msg-id E1uRIep-001ytk-05@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Fix possible Assert failure in verify_compact_attribute()

Sometimes the TupleDesc used in verify_compact_attribute() is shared
among backends, and since CompactAttribute.attcacheoff gets updated
during tuple deformation, it was possible that another backend would
set attcacheoff on a given CompactAttribute in the small window of time
from when the attcacheoff from the live CompactAttribute was being set
in the 'tmp' CompactAttribute and before the Assert verifying that the
live and tmp CompactAttributes matched.

Here we adjust the code to make a copy of the live CompactAttribute so
that we're not trying to Assert against a shared copy of it.

Author: David Rowley <dgrowleyml@gmail.com>
Reported-by: Alexander Lakhin <exclusion@gmail.com>
Discussion: https://postgr.es/m/7195e408-758c-4031-8e61-4f842c716ac0@gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/33b06a20016d8dd8dbdc1f6d6a9d79477c1104c5

Modified Files
--------------
src/backend/access/common/tupdesc.c | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)


pgsql-committers by date:

Previous
From: Andres Freund
Date:
Subject: pgsql: aio: Add missing memory barrier when waiting for IO handle
Next
From: Masahiko Sawada
Date:
Subject: pgsql: Fix re-distributing previously distributed invalidation messages