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 1lN3pb-0003jS-5o for pgsql-hackers@arkaria.postgresql.org; Fri, 19 Mar 2021 01:21:39 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lN3pa-0004IF-2q for pgsql-hackers@arkaria.postgresql.org; Fri, 19 Mar 2021 01:21:38 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lN3pZ-0004Hu-SH for pgsql-hackers@lists.postgresql.org; Fri, 19 Mar 2021 01:21:37 +0000 Received: from mail-ej1-x62f.google.com ([2a00:1450:4864:20::62f]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lN3pX-00052J-1Z for pgsql-hackers@lists.postgresql.org; Fri, 19 Mar 2021 01:21:36 +0000 Received: by mail-ej1-x62f.google.com with SMTP id ce10so6984575ejb.6 for ; Thu, 18 Mar 2021 18:21:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=tG0jmHT8G3ngLczYtgJAD5zQ7OujcxGzJ2RFbwhYLJ0=; b=jmVn+zccMoS6IQ/odmkth86gShLz/o05Nqk8E+FTl1fEVyAr/JeHbx8Lj7eTtW0l6I rZh57Bed+NdaX534VacyRWEgN6jAyi+denr4chYqHg8fRlhZPZZRHkDpUa7zMozpcBLe tv7iuORqaQPJHp9qQlbjt0pLPZGKPX/e7Wrryz8Pd8B+2/Q++FBFU7PXZ5AyygPAG/pY C3t5mRreFI/Iy33cT82tE+kH0BLBOJfPcwK1HpcCN69kszyGYYLTqv/vqevoC9A1WTih LBoJBJWakxeolx7ZahYVXfz0Px8JLSskU/v6HTSySJ2Yst2sG52ZjiEzBjcP0ghGDyXR oF1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=tG0jmHT8G3ngLczYtgJAD5zQ7OujcxGzJ2RFbwhYLJ0=; b=QeiF8n5sHGy69HpcrYvmXStIUVeaaU1g/kdluVoo2BhddqyXIekVI0+PQtBMR5DNn6 S+lGO9aSYfPr2AxKEhjXX/elRly4PsDuxnub/JpBgVxbsWz13s1oUOOBhFUiRfC8tyZO C4+dOCjAdt1Nhrnl0+kv5BcA+jWoTChqgGvBJpJDhq1Lco6/frKupC07nCpl3bVWPjUl GaQ9qBs8tk77QaYHfg0allTPwIT8Pf6Dm+JQRbx/41E13SmgqgH8ZdYuKgOb/UVD+J01 8bEiaQpQCWSxtDR9XHsuQN/HbDsVu1/5C4hB5e+dxqfxADBmt33klMm81Ooqpyi63vvA +jPQ== X-Gm-Message-State: AOAM532tYA2DgEjshX7tHAD2mIkB6GfY1jOFpUESV0hPvmlgpQeCIZZH IFunny9UJRjD1m41KUW7GeHzrYWyRBYiuVQqnaBBZfLthhz5ZPCrtbFRfhB0Xue2iW4bLX+JazL nml07pRqVZRy4J6owUFGCRW5TeIv2jqxzQhUU9YDJprmUoj1Vot7kTAZOuq+leHRinRofML16E6 SQOVlNYD2dWfENlTn+FwMwpeb3mDIJQwTqrO/FyQ6+hwYbYmXLWM7Q X-Google-Smtp-Source: ABdhPJw6oPr+gCjWwqeRpQ3ylMorl+KfoZgPKSEVREl8z+09x9ekVIGps+17tyH8Dqj+xRInklpQ/A== X-Received: by 2002:a17:906:f9db:: with SMTP id lj27mr1564968ejb.399.1616116893621; Thu, 18 Mar 2021 18:21:33 -0700 (PDT) Received: from [10.137.0.20] (ip-86-49-253-127.net.upcbroadband.cz. [86.49.253.127]) by smtp.gmail.com with ESMTPSA id r19sm3181506edp.52.2021.03.18.18.21.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 18 Mar 2021 18:21:32 -0700 (PDT) Subject: Re: cleanup temporary files after crash To: Euler Taveira , Thomas Munro , Michael Paquier Cc: Euler Taveira , Anastasia Lubennikova , Tomas Vondra , PostgreSQL Hackers , Tom Lane References: <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> <54663718-1d87-46f2-a27b-e7edacbfae0d@www.fastmail.com> <1ec33f3d-ea4c-28c8-502c-3eb0a008a6ac@enterprisedb.com> <34226249-c5ba-4780-a1bb-f3433d19716e@www.fastmail.com> <05d307fc-8391-4091-b279-1b3214658f10@www.fastmail.com> <049a2752-fc99-194d-31b2-b15ffa914cd4@enterprisedb.com> From: Tomas Vondra Message-ID: <482a6498-7713-e937-c554-7d235c415fba@enterprisedb.com> Date: Fri, 19 Mar 2021 02:21:29 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-CLOUD-SEC-AV-Info: enterprisedb,google_mail,monitor X-CLOUD-SEC-AV-Sent: true X-Gm-Spam: 0 X-Gm-Phishy: 0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 3/19/21 1:54 AM, Euler Taveira wrote: > On Thu, Mar 18, 2021, at 8:34 PM, Tomas Vondra wrote: >> Well, that's better, bit it still does not do the trick on the 32-bit >> machine - in that case a 1000 rows with int4 still fit into work_mem, so >> the temp file is not created. Per my experiments about 1040 rows are >> needed - soooo close ;-) So let's make it 2000. > My 32-bit laptop needs some repairs so I blindly chose 1k rows. > Yeah, it's not immediately obvious how many rows are needed. 2000 would be enough, but I just bumped it up to 5000 for good measure. >> We might as well check that the temp file actually exists, before >> killing the backend. Just to be sure. > Do you mean with remove_temp_files_after_crash = on? New version attached. > On second thought, we don't need that check. I realized the second part of the test (checking remove_temp_files_after_crash=off) actually does verify that we've created the file, so that should be OK. I've pushed the previous version with the 5000 rows. Let's see what crake and florican think about this ... regards -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company