Re: [HACKERS] Unlogged tables cleanup

From: Andres Freund <andres(at)anarazel(dot)de>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Kuntal Ghosh <kuntalghosh(dot)2007(at)gmail(dot)com>, konstantin knizhnik <k(dot)knizhnik(at)postgrespro(dot)ru>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [HACKERS] Unlogged tables cleanup
Date: 2019-05-13 17:38:34
Message-ID: 20190513173834.kgddkwrsvq7inapg@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 2019-05-13 13:21:33 -0400, Alvaro Herrera wrote:
> On 2019-May-13, Robert Haas wrote:
> > If that's the scenario, I'm not sure the smgrimmedsync() call is
> > sufficient. Suppose we log_smgrcreate() but then crash before
> > smgrimmedsync()... seems like we'd need to do them in the other order,
> > or else maybe just pass a flag to copy_file() telling it not to be so
> > picky.
>
> Well, if we do modify copy_file and thus we don't think the deletion
> step serves any purpose, why not just get rid of the deletion step
> entirely?

Well, it does serve a purpose:
/*
* We're in recovery, so unlogged relations may be trashed and must be
* reset. This should be done BEFORE allowing Hot Standby
* connections, so that read-only backends don't try to read whatever
* garbage is left over from before.
*/

but I'm somewhat doubtful that this logic is correct.

Greetings,

Andres Freund

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Gierth 2019-05-13 17:43:08 Re: SQL-spec incompatibilities in similar_escape() and related stuff
Previous Message Andres Freund 2019-05-13 17:37:35 Re: [HACKERS] Unlogged tables cleanup