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 1gh5p2-0002Rv-OV for pgsql-bugs@arkaria.postgresql.org; Wed, 09 Jan 2019 04:50:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gh5p0-0007a0-Ot for pgsql-bugs@arkaria.postgresql.org; Wed, 09 Jan 2019 04:50:30 +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 1gh5p0-0007Zt-IV for pgsql-bugs@lists.postgresql.org; Wed, 09 Jan 2019 04:50:30 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gh5ot-0003vj-Dp for pgsql-bugs@lists.postgresql.org; Wed, 09 Jan 2019 04:50:29 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 20804253AA; Tue, 8 Jan 2019 23:50:22 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Tue, 08 Jan 2019 23:50:22 -0500 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=fm3; bh=KA6QnaydQ8BBQfS5iJlzGkPePUx /eZebAiAhWAuaU1k=; b=t0VBgDaGqUh/IPw2C1Lg3sg6QiW4CgygJd01SDsff3S kr+paENy2HyHnGCooNkrG5kD/qgkcZNOuT+Cf0KuhcOM332i1o9/zoHf1gv0l2o8 Rr7ecPBAR9PunTSVBQB2YeXT8B8ZvlvuSaSXRuaIL6/sVqEWdDCfVZ3zUZA3F/Pt 33/bR2pMs1UiBprZF9DXnZXvszAf2F1WJRbcjTiIsvbxr3d9vi6sPTSEto6a83Hj Tt8SM1zFdLP8UF2qVt23tdB0IeP3b1IxggJGOScy9tWPsDotk4aWymplHXJih+YQ L/qt09+GBhZ2oVo2znR3AxHEAFSnh6+MkAhn4hx5HjA== 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=fm1; bh=KA6Qna ydQ8BBQfS5iJlzGkPePUx/eZebAiAhWAuaU1k=; b=U0TJshbxl9H8zqrIQbb1ks Q7Clk6Nltg0zGRV9umeB4fsX6egBSIYzxma6AaVztrwy+hGV8Vj2RmZvXAUHtZFT 0BrfqdJUN0k+RJTxP4Z5O3TnL4mmsoSU8blxrKxtx/s6UtyRNeyP9rLy2rk39d+c 6dwmePo58LrFUac5BfP9RrI+zKVDK27VRpBkIKLvLAvbVBef2x+pw5nrV0oeAXZM tYs2rPqNAPChxoSPAbP5aqDhVIUZxLIjXz4S+kZ3F7Ou79HgpcMEHLI0dmGFa1Zm DXcqUjBpigWYxcG8GDsjBlG2KEYaXjpb9T8nvTJM0YYl6J/dQUoosa+xxPDRkT/w == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledrfedtgdejkeculddtuddrgedtkedrtddtmd cutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthen uceurghilhhouhhtmecufedttdenucgfrhhlucfvnfffucdljedtmdenucfjughrpeffhf fvuffkfhggtggujgesghdtreertddtjeenucfhrhhomhepofhitghhrggvlhcurfgrqhhu ihgvrhcuoehmihgthhgrvghlsehprghquhhivghrrdighiiiqeenucfkphepuddukedrvd eguddrvdegkedrudeggeenucfrrghrrghmpehmrghilhhfrhhomhepmhhitghhrggvlhes phgrqhhuihgvrhdrgiihiienucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from paquier.xyz (mp76f1f890.ap.nuro.jp [118.241.248.144]) by mail.messagingengine.com (Postfix) with ESMTPA id 13372100B8; Tue, 8 Jan 2019 23:50:19 -0500 (EST) Date: Wed, 9 Jan 2019 13:50:17 +0900 From: Michael Paquier To: CNG L Cc: "pgsql-bugs@lists.postgresql.org" Subject: Re: Is this a bug in auto vacuum worker? Message-ID: <20190109045017.GI21835@paquier.xyz> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="zYo4Elh1vtcYNvbq" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --zYo4Elh1vtcYNvbq Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jan 08, 2019 at 10:47:01AM -0800, CNG L wrote: > In AutoVacWorkerMain(), the code calls on_shmem_exit(FreeWorkInfo,0) and > then kill() to send SIGUSR2 to autovacuum launcher process. In > FreeWorkInfo() it sets AutoVacuumShmem->av_signal[AutoVacRebalance] =3D t= rue. > But, is it possible that when autovacuum launcher=E2=80=99s SIGUSR2 handl= er checks > av_signal[AutoVacRebalance], FreeWorkInfo() haven=E2=80=99t set this flag= yet and > thus autovacuum launcher will miss the AutoVacRebalance event? No, I don't think so. There are a couple of instructions between the moment SIGUSR2 is sent from the worker to the launcher for rebalancing and the moment where on_shmem_exit() callbacks are called, still the launcher gets aware of the death of the worker in ProcKill, so the order of the events is right (double-checked manually as well): 1) Send SIGUSR2 from the worker to the launcher, asking for rebalancing. 2) shmem callback is called. 3) launcher noticies the death of the worker, sees the signal, and triggers the rebalancing. -- Michael --zYo4Elh1vtcYNvbq Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAlw1fYkACgkQnvQgOdby QH2F6A//VRCeHR+uKOk/s3qpzEpwdHFkf1rWBK2AU9Rgd8wrufuoAz7Aqch3j6WX UDbr+AsEui4ftaYutZGXkEia4G2//DRhrxjFxQnGAtydv/zdvqRpXs9L9DQdVg4c SeJLRSyuyf2us/CewmMC3hrUHFnLWLfX1ZLeY1JGyZKMV3iQ3FdUvs1jH3Buv6XU 6Oj4sf0Dkbb2bjZE3/Uwnt0kmU1+H4dpKValMyRo3dleHu+spcLzeI/K5oGca8qI CyJuJjo59ow+t6PgZ3NMB/CkKBt/AM86P5vdLOWmYLHbObO6jB8ILRZ4kPOzu9Es F+ofcKrlHyzXMnleYdgTOF7w0GeHT6McOiN5KHbu3QOKIY4AJWfLufSoXcUvN55b qxaGTrdBFQIVJiwpGXTKGob6hqm8eVj4/ZDW87qWHBEciOx0sZ/75FFi4wfKSb08 BVVt/1p1gqEO4AtQZutrqic/uU9Loo621JenC1LLGE7IX1Bn7scX72a3uRVnhJ8Y 0IX+nNxKoQgXavdE7qa2Fe9PbTGpTy7Q7IJSpWmOHJVmKVBXr14eTGZGNGFGVR7q AV8ZW4TH81etjLZXKBb6PdGvvEHO55ES/bIaF2AsktNqqfZ1jBPpfx6MAlGODYO8 HEr3e4RTrz04k2HMYDzTFTiapSnQRXz4EEB0NQTbbsX8MudfN6Y= =6KpA -----END PGP SIGNATURE----- --zYo4Elh1vtcYNvbq--