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 1hQdTN-0001pp-0L for pgsql-bugs@arkaria.postgresql.org; Tue, 14 May 2019 19:52:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hQdTK-0004Di-K9 for pgsql-bugs@arkaria.postgresql.org; Tue, 14 May 2019 19:52:22 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hQdTK-0004Da-CJ for pgsql-bugs@lists.postgresql.org; Tue, 14 May 2019 19:52:22 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hQdTA-0006ES-GG for pgsql-bugs@lists.postgresql.org; Tue, 14 May 2019 19:52:22 +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 x4EJq4Ji026333; Tue, 14 May 2019 15:52:04 -0400 From: Tom Lane To: Yuli Khodorkovskiy cc: pgsql-bugs@lists.postgresql.org, Peter Eisentraut Subject: Re: BUG #15804: Assertion failure when using logging_collector with EXEC_BACKEND In-reply-to: <27CD45B5-88F7-4A09-8B31-EFE41FC37FE1@crunchydata.com> References: <15804-3721117bf40fb654@postgresql.org> <27CD45B5-88F7-4A09-8B31-EFE41FC37FE1@crunchydata.com> Comments: In-reply-to Yuli Khodorkovskiy message dated "Tue, 14 May 2019 14:45:09 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <26331.1557863524.1@sss.pgh.pa.us> Date: Tue, 14 May 2019 15:52:04 -0400 Message-ID: <26332.1557863524@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Yuli Khodorkovskiy writes: > Attached is a patch that fixes the issue in the bug report. I do not think this is a very good way to fix it (even assuming that it works, which I'm unsure of --- in particular, doing this would alter the order of changes to postmaster.pid, possibly breaking pg_ctl or other tools that look at that file). The whole point of commit 57431a911 was to switch to log-collector logging before we've done anything very interesting, and that would surely include shmem setup. I'm a bit surprised actually that Peter didn't move the SysLogger_Start call even further up; in principle it ought to be safe to do it as soon as we have the data directory lock file. It might be better to give up the assertion in PGSharedMemoryNoReAttach, and just make it work more like PGSharedMemoryDetach, ie "detach if UsedShmemSegAddr is set, else do nothing". I don't remember for sure, but if we do that, there might be no functional difference anymore between those two functions, in which case we might as well merge 'em. regards, tom lane