Re: shared tempfile was not removed on statement_timeout

From: Justin Pryzby <pryzby(at)telsasoft(dot)com>
To: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, "Bossart, Nathan" <bossartn(at)amazon(dot)com>
Subject: Re: shared tempfile was not removed on statement_timeout
Date: 2020-07-29 01:37:24
Message-ID: 20200729013724.GM20393@telsasoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Jul 27, 2020 at 05:39:02AM -0500, Justin Pryzby wrote:
> On Mon, Jul 27, 2020 at 08:00:46PM +1200, Thomas Munro wrote:
> > Why can't tuplesort_end do it?
>
> Because then I think the parallel workers remove their own files, with tests
> failing like:
>
> +ERROR: could not open temporary file "0.0" from BufFile "0": No such file or directory
>
> I look around a bit more and came up with this, which works, but I don't know
> enough to say if it's right.

I convinced myself this is right, since state->nParticipants==-1 for workers.
Only the leader should do the cleanup.

Added here:
https://commitfest.postgresql.org/29/2657/

--
Justin

Attachment Content-Type Size
v1-0001-explicity-remove-shared-fileset.patch text/x-diff 1.2 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2020-07-29 01:41:02 Re: Threading in BGWorkers (!)
Previous Message David Rowley 2020-07-28 23:44:52 Re: HashAgg's batching counter starts at 0, but Hash's starts at 1.