Re: BUG #16739: Temporary files not deleting from data folder on disk - Mailing list pgsql-bugs

From Adrien Nayrat
Subject Re: BUG #16739: Temporary files not deleting from data folder on disk
Date
Msg-id dc3b7ef9-2867-734b-0804-5bb4c9cef063@anayrat.info
Whole thread Raw
In response to Re: BUG #16739: Temporary files not deleting from data folder on disk  (Dilip Kumar <dilipbalaut@gmail.com>)
Responses Re: BUG #16739: Temporary files not deleting from data folder on disk  (Dilip Kumar <dilipbalaut@gmail.com>)
List pgsql-bugs
On 6/5/23 12:14, Dilip Kumar wrote:
> IIUC, this flag is for the temp files created for query level
> operation so this will clean up the files like  "pgsql_tmp" but in
> this thread, we are talking about the files related to temp tables
> starting with "t_"

I am not sure per comment and code in fd.c :


/*
  * Remove temporary and temporary relation files left over from a prior
  * postmaster session
  *
  * This should be called during postmaster startup.  It will forcibly
  * remove any leftover files created by OpenTemporaryFile and any leftover
  * temporary relation files created by mdcreate.
  *
  * During post-backend-crash restart cycle, this routine is called when
  * remove_temp_files_after_crash GUC is enabled. Multiple crashes while
  * queries are using temp files could result in useless storage usage 
that can
  * only be reclaimed by a service restart. The argument against 
enabling it is
  * that someone might want to examine the temporary files for debugging
  * purposes. This does however mean that OpenTemporaryFile had better 
allow for
  * collision with an existing temp file name.

The function RemovePgTempFiles is called, which call 
RemovePgTempRelationFiles, then RemovePgTempRelationFilesInDbspace
and looks_like_temp_rel_name which check:
/* t<digits>_<digits>, or t<digits>_<digits>_<forkname> */




-- 
Adrien NAYRAT





pgsql-bugs by date:

Previous
From: Dilip Kumar
Date:
Subject: Re: BUG #16739: Temporary files not deleting from data folder on disk
Next
From: Dilip Kumar
Date:
Subject: Re: BUG #16739: Temporary files not deleting from data folder on disk