Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hR8Mu-0000Rp-TH for pgsql-bugs@arkaria.postgresql.org; Thu, 16 May 2019 04:51:49 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hR8Mt-0004Am-6d for pgsql-bugs@arkaria.postgresql.org; Thu, 16 May 2019 04:51:47 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hR8Ms-00047W-PB for pgsql-bugs@lists.postgresql.org; Thu, 16 May 2019 04:51:46 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hR8Ml-0004CR-Th for pgsql-bugs@lists.postgresql.org; Thu, 16 May 2019 04:51:45 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x4G4pYVi031438; Thu, 16 May 2019 00:51:35 -0400 From: Tom Lane To: Michael Paquier cc: Yuli Khodorkovskiy , pgsql-bugs@lists.postgresql.org, Peter Eisentraut Subject: Re: BUG #15804: Assertion failure when using logging_collector with EXEC_BACKEND In-reply-to: <20190516043618.GD1415@paquier.xyz> References: <15804-3721117bf40fb654@postgresql.org> <27CD45B5-88F7-4A09-8B31-EFE41FC37FE1@crunchydata.com> <26332.1557863524@sss.pgh.pa.us> <20190515073125.GA1517@paquier.xyz> <4643.1557931189@sss.pgh.pa.us> <20190516013808.GA1415@paquier.xyz> <20190516021903.GB1415@paquier.xyz> <28927.1557977558@sss.pgh.pa.us> <20190516035617.GC1415@paquier.xyz> <20190516043618.GD1415@paquier.xyz> Comments: In-reply-to Michael Paquier message dated "Thu, 16 May 2019 13:36:18 +0900" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <31436.1557982294.1@sss.pgh.pa.us> Date: Thu, 16 May 2019 00:51:34 -0400 Message-ID: <31437.1557982294@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Michael Paquier writes: > On Thu, May 16, 2019 at 12:56:17PM +0900, Michael Paquier wrote: >> The test is able to pass, but we have a race condition between the >> moment the backend file gets saved and the moment we allow it to be >> read. I have not spent much time checking the stack between >> InitializeMaxBackends() and RemovePgTempFiles() in postmaster.c, but >> 57431a9 triggers the failure. > Oh, I think I got it. The issue is that we call RemovePgTempFiles() > after starting the syslogger. This cannot be run with other processes > running in parallel, and with EXEC_BACKEND there is the extra case > where we have a pgsql_tmp/ at the root of the data folder, so the > syslogger complains on that. By making RemovePgTempFiles() happen > before starting the syslogger, then the test complains again about the > assertion without my previous patch applied of course. With the patch > applied, I get no complains. Hm, should we separate the cleanup of the root pgsql_tmp/ from the rest of what RemovePgTempFiles does? I'm still feeling like we should be trying to launch the syslogger as soon as possible. regards, tom lane