Re: Temp table handling after anti-wraparound shutdown (Was: BUG #15840)

From: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, Thierry Husson <thusson(at)informiciel(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Temp table handling after anti-wraparound shutdown (Was: BUG #15840)
Date: 2019-06-11 12:08:36
Message-ID: CAD21AoDVqebWy6dOWV5iNsh8O_CT2ZDAGHQcX-W13OAW+XC2tA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

On Sat, Jun 8, 2019 at 9:26 AM Andres Freund <andres(at)anarazel(dot)de> wrote:
>
>
> A more aggressive approach would be to teach vac_update_datfrozenxid()
> to ignore orphaned temp tables - perhaps even by heap_inplace'ing an
> orphaned table's relfrozenxid/relminmxid with InvalidTransactionId. We'd
> not want to do that in do_autovacuum() - otherwise the schema won't get
> cleaned up, but for database widevacuums that seems like it could be
> good approach.
>

FWIW I like this approach. We don't need to calculate new datfrozenxid
while including orphaned temp tables. It both improves behavior and
fixes this issue. Also with that approach we will not need stop
database cluster and do vacuuming in single user mode. The making the
vacuum command cleanup orphaned temp tables would be helpful in the
case where we reached to wraparound while having active temp tables,
it doesn't happen in normal use case though.

Regards,

--
Masahiko Sawada
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2019-06-11 12:32:50 BUG #15845: The repodata section is missing in the official repo
Previous Message Tobias Gierke 2019-06-11 11:49:24 PostgreSQL 11.3 hangs forever during DEALLOCATE statement

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavlo Golub 2019-06-11 12:19:43 ReplicationSlotCtl: undefined reference
Previous Message Dmitry Dolgov 2019-06-11 11:59:20 Re: fix psql \conninfo & \connect when using hostaddr