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

From Euler Taveira
Subject Re: cleanup temporary files after crash
Date
Msg-id 54663718-1d87-46f2-a27b-e7edacbfae0d@www.fastmail.com
Whole thread Raw
In response to Re: cleanup temporary files after crash  (Tomas Vondra <tomas.vondra@enterprisedb.com>)
Responses Re: cleanup temporary files after crash  (Tomas Vondra <tomas.vondra@enterprisedb.com>)
List pgsql-hackers
On Thu, Mar 18, 2021, at 4:20 PM, Tomas Vondra wrote:
I think a better way to test this would be to use a tuple lock:
I predicated such issues with this test. Your suggestion works for me. Maybe
you should use less rows in the session 2 query.

setup:

  create table t (a int unique);

session 1:

  begin;
  insert into t values (1);
  ... keep open ...

session 2:

   begin;
   set work_mem = '64kB';
   insert into t select i from generate_series(1,10000) s(i);
   ... should block ...

Then, once the second session gets waiting on the tuple, kill the
backend. We might as well test that there actually is a temp file first,
and then test that it disappeared.
Your suggestion works for me. Maybe you could use less rows in the session 2
query. I experimented with 1k rows and it generates a temporary file.


--
Euler Taveira

pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: [HACKERS] Custom compression methods
Next
From: Peter Eisentraut
Date:
Subject: Re: default result formats setting