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 1hSweS-0002WS-Vn for pgsql-bugs@arkaria.postgresql.org; Tue, 21 May 2019 04:45: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 1hSweR-0000CW-L0 for pgsql-bugs@arkaria.postgresql.org; Tue, 21 May 2019 04:45:23 +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 1hSweR-0000CP-DT for pgsql-bugs@lists.postgresql.org; Tue, 21 May 2019 04:45:23 +0000 Received: from wout4-smtp.messagingengine.com ([64.147.123.20]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hSweO-0005I1-Ne for pgsql-bugs@lists.postgresql.org; Tue, 21 May 2019 04:45:23 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 3455572B; Tue, 21 May 2019 00:45:18 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Tue, 21 May 2019 00:45:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm1; bh=m4LcA3p2JhF/jS0s92fhj0wajLe fd8tN9XqpYT9VKD0=; b=ZT5o8Cbyxj9LEuj8eJhjmDLxmNLb3GaOZxBWz6UE4uw gT+brIEwg7bmqTgtQY4rQufUGy2DsPek/wzmQu5I4CIqEmgJDhxlhSGTQy1o//ap tPO9PaxqUFa5vG8OqwSBOq10bh30tYY/VGVAuU0oTBErzZL6Ics4u2fPBYQXegll YAoXxce3kG/f26/0ZLWSKCeU6SwjuymDF0RzlMq5m041vUWhWbwKTB51fkywBTL3 sBvZk1PMdJ3ujETNXVWg7VqayzXbdDLjs2EYHnnUNPeIZmuv1dqVbx/wjtAfFsoQ 4keZHXzonKydlxjo1bcLH0xrYtxnvkwAq+HG5DJlv6w== 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=m4LcA3 p2JhF/jS0s92fhj0wajLefd8tN9XqpYT9VKD0=; b=Yjd3gAHmO2pb4Y+1eaUjLQ gYuCHCXLDFpWKSjT1IlYzU5DuqCbhYzF6lUzzNq0EYKpdDPp2njVcB0Ndf+kKEK8 vNXgbge0T0JL+KFhIAqtzKoKulESlF/qSDTcq4kCmwBIGd2lxiko0Dh0pKR4APvU 0WchHnvId2Ksy4kgeOTg544D5z40egAGQCZRoL+XPBgvyFtPSTduxOiXZCPyurE8 gQxIpIqyEFBp7EENfeefUduoOWWel692p123bMjiCTxiu95Vl6kgv65e0lo98QNB wlQkFef9asHE801EXiJ5wO8CHtJ+JQHznUl46lGtbCl/VzYw6Y000hdXoHuU1PsQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduuddruddtledgkeeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdlfeehmdenucfjughrpeffhffvuffkfhggtggujgesghdtreertddt vdenucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprg hquhhivghrrdighiiiqeenucffohhmrghinhepphhoshhtghhrrdgvshenucfkphepuddu uddruddtvddrudektddrudekheenucfrrghrrghmpehmrghilhhfrhhomhepmhhitghhrg gvlhesphgrqhhuihgvrhdrgiihiienucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from paquier.xyz (ee0822lan1.rev.em-net.ne.jp [111.102.180.185]) by mail.messagingengine.com (Postfix) with ESMTPA id 1E66080060; Tue, 21 May 2019 00:45:14 -0400 (EDT) Date: Tue, 21 May 2019 13:45:12 +0900 From: Michael Paquier To: Tom Lane Cc: Andrew Dunstan , Andres Freund , Peter Eisentraut , Yuli Khodorkovskiy , pgsql-bugs@lists.postgresql.org Subject: Re: BUG #15804: Assertion failure when using logging_collector with EXEC_BACKEND Message-ID: <20190521044512.GD1921@paquier.xyz> References: <20190518093522.GA19212@paquier.xyz> <28565.1558196308@sss.pgh.pa.us> <20190519004344.GA3653@paquier.xyz> <22995.1558278322@sss.pgh.pa.us> <27719.1558282181@sss.pgh.pa.us> <16df9d01-8b03-2664-a18c-16c40186f5ab@2ndQuadrant.com> <2702.1558289980@sss.pgh.pa.us> <20190520012728.GC1923@paquier.xyz> <1664.1558325417@sss.pgh.pa.us> <7927.1558364465@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="7LkOrbQMr4cezO2T" Content-Disposition: inline In-Reply-To: <7927.1558364465@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --7LkOrbQMr4cezO2T Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, May 20, 2019 at 11:01:05AM -0400, Tom Lane wrote: > In other words, the right way to think about this is less "move > syslogger launch to earlier" and more "move port opening to later". > I did some cursory testing of that idea with the attached patch, > which simply relocates the port opening logic to below where > syslogger start is (though "git diff" insists on presenting it > differently :-(). I also moved and recommented the emission > of the "starting ..." log entry. It works under EXEC_BACKEND, > but I'm not fool enough to believe that that proves it works > under Windows :-(. I can see what you have done, no worries. > One issue with this is that we can't be sure we have sole control > of the postmaster port number at the time we create shmem. Couldn't that also be a problem for some users? This means that there is a window where the port won't be opened but the external PID file can be found. Some tools could be broken as an effect of that. > Hence, to avoid undesirable conflicts of shmem, we should change > things to base the shmem key on the datadir's ID not the port > number, as was already speculated about in > https://postgr.es/m/16908.1557521200@sss.pgh.pa.us This would be actually nice to change as you suggest. > Another point is that we want to be sure this doesn't change > the order in which lockfiles are released at shutdown. That > seems OK (I confirmed by strace'ing that the postmaster's > final syscalls are still done in the same order) but it could > use some additional eyeballs on it. >=20 > There may be some other reorderings that would be a good idea. > In particular I'm thinking that the CreateOptsFile call should > be pushed down, so that it doesn't get written until we know > that the port number is OK. Is this thread a good place to discuss all those changes by the way? After all the recent activity in this area, a new thread and a discussion for v13 would be I think appropriate. I would rather not play with the devil for v12. -- Michael --7LkOrbQMr4cezO2T Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAlzjglgACgkQnvQgOdby QH0mKg//Z4JRKbqSc9I2JCrETjhVQdK9Z06G3VSbshPzJSDsy/Kk4GnRCOvRc6Rm Zet8Y06Zv6reG8BkBuJCkVIZMvzDcxVj5QYVLxRIOgnxJG//Xtkgq1EiWinLZ/QH sYRRHWQnBuL8id6QuhZHnaAAXKZJxYvaMhqEr9yLopKg1k2EM/oNDYoWBsjtOqC1 i5XnpBwTBVNjaE3FjCg4DyOsigH1DG5UY6cDVHfgMDMnV2Ztt90npYB2pYeiJHkz SG+4pS5DIkvFn6RTcmEa9/10WGEtnpzdFswiX/wHQ7pwwOHvydqJQf7CZPv9Xt1y 2c8rmQnb0r4J3vNbLR9+Iu5vC1ysF5Sc0pP07rXJjPZZotCzOpYn/hosYv7jh9wr lffRIxWHUbJCmmFOVuCRT1PpbtLb9UCfL8JWWckAEtolS5ynzW/5b5LgxzauBff8 v+x/qxxedeUPwrXb010Z5nD9mZKGPy+8Md6pTnFhXsE1L0MsXC7+vD3GrDDgYDbW QVi4shuPvejmW7+nf33pXb6UvCyBFjX608ouAhGltHf0Rk1NJ6v83fvfCLLkleR7 Oijd/1Rr9hc1KI6+1pVjaStQYrO5euFevLLySC6/ec58epPOd/4pbpgZwrKyD3lJ 33p0CRZ0KnT1LKYizx+X1OjlLtE9bjlIjeI+hq1BXwVfvPQXX18= =Z7vp -----END PGP SIGNATURE----- --7LkOrbQMr4cezO2T--