Re: cleanup temporary files after crash - Mailing list pgsql-hackers

From Anastasia Lubennikova
Subject Re: cleanup temporary files after crash
Date
Msg-id 1982ee3c-54c3-280a-806a-fd28ad8f19e6@postgrespro.ru
Whole thread Raw
In response to Re: cleanup temporary files after crash  (Michael Paquier <michael@paquier.xyz>)
Responses Re: cleanup temporary files after crash  (Euler Taveira <euler.taveira@2ndquadrant.com>)
List pgsql-hackers
On 01.11.2020 04:25, Michael Paquier wrote:
> On Sat, Oct 31, 2020 at 09:01:15PM -0300, Euler Taveira wrote:
>> I thought about not providing a GUC at all or provide it in the developer
>> section. I've never heard someone saying that they use those temporary
>> files to investigate an issue. Regarding a crash, all information is already
>> available and temporary files don't provide extra details. This new
>> GUC is just to keep the previous behavior. I'm fine without the GUC, though.
> The original behavior is as old as 4a5f38c4, and last time we talked
> about that there were arguments about still keeping the existing
> behavior to not cleanup files during a restart-after-crash scenario
> for the sake of being useful just "in case".  I have never used that
> property myself, TBH, and I have seen much more cases of users caring
> about the data folder not facing an ENOSPC particularly if they don't
> use different partitions for pg_wal/ and the main data folder.
> --
> Michael

Thank you, Euler for submitting this.
+1 for the feature. One of the platforms we support uses temp files a 
lot and we faced the problem, while never actually used these orphan 
files for debugging purposes.

I also think that the GUC is not needed here. This 'feature' was 
internal from the very beginning, so users shouldn't care about 
preserving old behavior. Without the GUC the patch is very simple, 
please see attached version. I also omit the test, because I am not sure 
it will be stable given that the RemovePgTempFiles() allows the 
possibility of failure.

-- 
Anastasia Lubennikova
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company


Attachment

pgsql-hackers by date:

Previous
From: Magnus Hagander
Date:
Subject: Re: Online verification of checksums
Next
From: Kyotaro Horiguchi
Date:
Subject: Re: ResourceOwner refactoring