pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Avoid using tuple from syscache for update of pg_database.datfro
Date: Tue, 08 Dec 2020 03:23:00 +0000
Message-ID: <E1kmTae-0004TC-Cq@gemulon.postgresql.org> (raw)

Avoid using tuple from syscache for update of pg_database.datfrozenxid

pg_database.datfrozenxid gets updated using an in-place update at the
end of vacuum or autovacuum.  Since 96cdeae, as pg_database has a toast
relation, it is possible for a pg_database tuple to have toast values
if there is a large set of ACLs in place.  In such a case, the in-place
update would fail because of the flattening of the toast values done for
the catcache entry fetched.  Instead of using a copy from the catcache,
this changes the logic to fetch the copy of the tuple by directly
scanning pg_database.

Per the lack of complaints on the matter, no backpatch is done.  Note
that before 96cdeae, attempting to insert such a tuple to pg_database
would cause a "row is too big" error, so the end-of-vacuum problem was
not reachable.

Author: Ashwin Agrawal, Junfeng Yang
Discussion: https://postgr.es/m/DM5PR0501MB38800D9E4605BCA72DD35557CCE10@DM5PR0501MB3880.namprd05.prod.outlook.c...

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/947789f1f5fb61daf663f26325cbe7cad8197d58

Modified Files
--------------
src/backend/access/heap/heapam.c |  4 ++++
src/backend/commands/vacuum.c    | 20 ++++++++++++++++++--
2 files changed, 22 insertions(+), 2 deletions(-)



view thread (3+ messages)  latest in thread

Message-ID: <E1kmTae-0004TC-Cq@gemulon.postgresql.org>
Permalink:  ../E1kmTae-0004TC-Cq@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1kmTae-0004TC-Cq@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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: michael@paquier.xyz
  Subject: Re: pgsql: Avoid using tuple from syscache for update of pg_database.datfro
  In-Reply-To: <E1kmTae-0004TC-Cq@gemulon.postgresql.org>
  References: <E1kmTae-0004TC-Cq@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