pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: David Rowley <drowley@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix possible Assert failure in verify_compact_attribute()
Date: Mon, 16 Jun 2025 22:50:27 +0000
Message-ID: <E1uRIep-001ytk-05@gemulon.postgresql.org> (raw)

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



Message-ID: <E1uRIep-001ytk-05@gemulon.postgresql.org>
Permalink:  ../E1uRIep-001ytk-05@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1uRIep-001ytk-05@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: drowley@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Fix possible Assert failure in verify_compact_attribute()
  In-Reply-To: <E1uRIep-001ytk-05@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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