pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Make autovacuum more selective about temp tables to keep
Date: Thu, 27 Dec 2018 19:04:16 +0000
Message-ID: <E1gcax6-00011m-RO@gemulon.postgresql.org> (raw)

Make autovacuum more selective about temp tables to keep

When temp tables are in danger of XID wraparound, autovacuum drops them;
however, it preserves those that are owned by a working session.  This
is desirable, except when the session is connected to a different
database (because the temp tables cannot be from that session), so make
it only keep the temp tables only if the backend is in the same database
as the temp tables.

This is not bulletproof: it fails to detect temp tables left by a
session whose backend ID is reused in the same database but the new
session does not use temp tables.  Commit 943576bddcb5 fixes that case
too, for branches 11 and up (which is why we don't apply this fix to
those branches), but back-patching that one is not universally agreed
on.

Discussion: https://postgr.es/m/20181214162843.37g6h3txto43akrb@alvherre.pgsql
Reviewed-by: Takayuki Tsunakawa, Michaƫl Paquier

Branch
------
REL9_4_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/5199abaca318f0571aa3df09f5b700335d7d62d1

Modified Files
--------------
src/backend/postmaster/autovacuum.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)



view thread (4+ messages)

Message-ID: <E1gcax6-00011m-RO@gemulon.postgresql.org>
Permalink:  ../E1gcax6-00011m-RO@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1gcax6-00011m-RO@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: alvherre@alvh.no-ip.org
  Subject: Re: pgsql: Make autovacuum more selective about temp tables to keep
  In-Reply-To: <E1gcax6-00011m-RO@gemulon.postgresql.org>
  References: <E1gcax6-00011m-RO@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