Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lMyvr-0001Vp-Dx for pgsql-hackers@arkaria.postgresql.org; Thu, 18 Mar 2021 20:07:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lMyvp-0001vw-II for pgsql-hackers@arkaria.postgresql.org; Thu, 18 Mar 2021 20:07:45 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lMyvn-0001vG-U5 for pgsql-hackers@lists.postgresql.org; Thu, 18 Mar 2021 20:07:45 +0000 Received: from [64.147.123.20] (helo=wout4-smtp.messagingengine.com) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lMyvj-00047w-TJ for pgsql-hackers@lists.postgresql.org; Thu, 18 Mar 2021 20:07:43 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.west.internal (Postfix) with ESMTP id 47531F48; Thu, 18 Mar 2021 16:07:26 -0400 (EDT) Received: from imap21 ([10.202.2.71]) by compute2.internal (MEProxy); Thu, 18 Mar 2021 16:07:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eulerto.com; h= mime-version:message-id:in-reply-to:references:date:from:to:cc :subject:content-type; s=fm1; bh=AVxgEeHRBas7lB+YW72DVf19ddCDixe xvLyZrJHMK1Q=; b=cNa0oU8UspPsoOrAVSmIK7xHsRuTR502djMevtUM1sdMZ9k gTXlat4+n+0n86hW1w2R8dWms66+q1IdSl2rQfeNbZo9/tKB6ZyMX6s4QdsfOdxj vZabUkjpexo96oiU0hnZI8ytQ3QvqlfdO4WY8LMUaRL98eEDZo+rq4D0lb9becgg dlgxoMatihAco6qIBvXJf/2LlHDOpa7eLqEZz+FtbnMNnz1yE8CmRmt2h348OfKA px9KXxmYh+eXhhet9Ol9d4y5TfwJYlrQAB8v307wz+4BitBpMfS8m2OBotoFCqwO Z+jDg2IXYKyrO02SLsV5fjQ5SUYuv/rvib1cCBA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=AVxgEe HRBas7lB+YW72DVf19ddCDixexvLyZrJHMK1Q=; b=DZu5oe9UX6bhFViVNULqlT GOMKzR/FVTAngYCUdoh8pxcN2TLVb0VRV8bOae2R77oXqH6KL0Hc3DEcdrot89XK iAiWUjIt2wNU7Snu3CZSJvsRXotVKOpaHsqVsy8TNpim4Dhy5/pxmEWPm+n/mPcz kxt7xUotxcsCf6bRb9YhRWNCu97tp8Kc9fUH6njsX3mdnUcw7KJbiNpNduUElnfj oMFZO9Ifqxb5EwPttV/WnGvvuDqDZR0z2nK4mBNLWsjN3+Siiaurlv5P9JQKGEBr MgfGF0D3bTGy2DWSI6xOk3EEqCunc4dNDSGlu6IfASUtqss1Pkm3HUru2f9xsyxA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudefiedgudefhecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefofgggkfgjfhffhffvufgtsegrtderreerredtnecuhfhrohhmpedfgfhu lhgvrhcuvfgrvhgvihhrrgdfuceovghulhgvrhesvghulhgvrhhtohdrtghomheqnecugg ftrfgrthhtvghrnhepjeethfeuvdfgffdtteevudeftdejueffkeelveekhfevkeegleef hfejhedtjeegnecuffhomhgrihhnpegvnhhtvghrphhrihhsvggusgdrtghomhenucevlh hushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegvuhhlvghrsegv uhhlvghrthhordgtohhm X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 9E75551C005E; Thu, 18 Mar 2021 16:07:24 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.5.0-alpha0-206-g078a48fda5-fm-20210226.001-g078a48fd Mime-Version: 1.0 Message-Id: <54663718-1d87-46f2-a27b-e7edacbfae0d@www.fastmail.com> In-Reply-To: References: <20201028184252.5vpoe65kcfebbmmf@development> <20201101012555.GC3000@paquier.xyz> <1982ee3c-54c3-280a-806a-fd28ad8f19e6@postgrespro.ru> <363cb85c-3a03-9a49-b830-8b645c1241d9@enterprisedb.com> <4245d284-97b2-4056-96c2-455792d9b564@www.fastmail.com> <8740f056-a7c0-ff12-0a50-de5324a928ee@enterprisedb.com> <822e3a60-56a1-219d-c473-365751c3e108@enterprisedb.com> Date: Thu, 18 Mar 2021 17:06:23 -0300 From: "Euler Taveira" To: "Tomas Vondra" , "Thomas Munro" , "Michael Paquier" Cc: "Euler Taveira" , "Anastasia Lubennikova" , "Tomas Vondra" , "PostgreSQL Hackers" , "Tom Lane" Subject: Re: cleanup temporary files after crash Content-Type: multipart/alternative; boundary=cdf430f2c7d8428884de85c67f7be92c X-Host-Lookup-Failed: Reverse DNS lookup failed for 64.147.123.20 (deferred) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --cdf430f2c7d8428884de85c67f7be92c Content-Type: text/plain 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 EDB https://www.enterprisedb.com/ --cdf430f2c7d8428884de85c67f7be92c Content-Type: text/html Content-Transfer-Encoding: quoted-printable
On Thu, Mar 18,= 2021, at 4:20 PM, Tomas Vondra wrote:
I think a better way to test this would be t= o use a tuple lock:
I predicated such issues = with this test. Your suggestion works for me. Maybe
you sh= ould 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:

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

Then, once the second session gets waiting on the tupl= e, kill the
backend. We might as well test that there actu= ally is a temp file first,
and then test that it disappear= ed.
Your suggestion works for me. Maybe you c= ould use less rows in the session 2
query. I experimented = with 1k rows and it generates a temporary file.

=

--
<= /div>
Euler Taveira

--cdf430f2c7d8428884de85c67f7be92c--