Re: [PROPOSAL] Drop orphan temp tables in single-mode

From: Alexander Korotkov <a(dot)korotkov(at)postgrespro(dot)ru>
To: Arthur Zakirov <a(dot)zakirov(at)postgrespro(dot)ru>
Cc: Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Grigory Smolkin <g(dot)smolkin(at)postgrespro(dot)ru>
Subject: Re: [PROPOSAL] Drop orphan temp tables in single-mode
Date: 2019-03-07 09:57:40
Message-ID: CAPpHfdu1kae25eVagyZc-Ahbh56iCrNLRHVRD+k_VQYXdoSenw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi!

On Thu, Mar 7, 2019 at 12:46 PM Arthur Zakirov <a(dot)zakirov(at)postgrespro(dot)ru> wrote:
> In some cases if PostgreSQL encounters with wraparound PostgreSQL might
> leave created temporary tables even after shutdown.
>
> This orphan temporary tables prevent VACUUM to fix wraparound. It is
> because in single mode VACUUM considers orphan temp tables as temp
> tables of other backends.
>
> Grigory reported that one of our client did stuck with fixing wraparound
> by because he didn't know that he has orphaned temp tables left by a
> backend after wraparound.
>
> This patch fixes the issue. With it VACUUM deletes orphaned tables in
> single mode.
>
> See also thread in general (I'm not sure that orphan temp tables were
> cause here though):
> https://www.postgresql.org/message-id/CADU5SwN6u4radqQgUY2VjEyqXF0KJ6A09PYuJjT%3Do9d7vzM%3DCg%40mail.gmail.com
>
> If the patch is interesting I'll add it to the next commitfest and label
> it as 'v13'.

As far as I understand, it's intended that user should be able to fix
wraparound in single mode. Assuming this issue may prevent user form
doing this and fix is quite trivial, should we consider backpatching
this?

------
Alexander Korotkov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Etsuro Fujita 2019-03-07 10:27:33 Re: Problems with plan estimates in postgres_fdw
Previous Message Arthur Zakirov 2019-03-07 09:46:06 [PROPOSAL] Drop orphan temp tables in single-mode