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 1iKuDJ-0005q4-Tf for pgsql-hackers@arkaria.postgresql.org; Thu, 17 Oct 2019 01:04:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iKuDI-0008Jl-2B for pgsql-hackers@arkaria.postgresql.org; Thu, 17 Oct 2019 01:04:24 +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 1iKuDH-0008Jc-PM for pgsql-hackers@lists.postgresql.org; Thu, 17 Oct 2019 01:04:23 +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 1iKuDF-0007QV-Bz for pgsql-hackers@lists.postgresql.org; Thu, 17 Oct 2019 01:04:23 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 2F0D122085; Wed, 16 Oct 2019 21:04:19 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Wed, 16 Oct 2019 21:04:19 -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=fm3; bh=YGpRc1SN+JGLn7J5/IhIfuvfObS 6eyh66T0mVBdkE5Y=; b=au8Lgo6pZCV+YBGtmDcf+D4BNWhMNZVUphVAHftjgqU WO7Ay07ymApTnGL5bvgElSPn9jqC1jRrQdTzQP4V34yZGgMD7K5EdJRXhqz1jN/U HBGVAwR9H2Ghf1Fln6V/psuZIWGOksF5MQbfORdr1XRYGzGHcp0EL9CIPUGlNLF9 m6+eI+5s/suqCK48duxeh07en9lJw7sUE5rMQsb8R8lzWGYTQZNL5qhzhanepV0+ k4tfpN0st+r41xi+RklktorAnbj07035ToaUclf60VtStZi4QV3BkT3aRJ5c/ubw MqAhqhdY3wXUrZ+WE23fPJD0vlIoTyVVVp99UXHmhbw== 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=YGpRc1 SN+JGLn7J5/IhIfuvfObS6eyh66T0mVBdkE5Y=; b=K78bYAhF8etzS1LdzqHlOx mQ5ts4zH8Mu07yk9FVhMc8c9i74u2PlbYnyUS3h0OY5QKJkkZ0VOZBq7qN7GMqbQ atZStdCDQs976bHMEg4RrLpvMfwxylV9ohHjlgtYADCR8Mto7XcvK7AtwrNpKDCs sJa/DxZsifL/HenYhdaF2bjYu+HzU3hHXHdyLnLEPAxNOT2GH4EkRUQdb5g3tnZ3 aePNIXOxcwGJOAR/q5PkgRvgHpl7oUhGYWt7G1SwFJ0d+VFi62TprW8JJzFGEedj 3jZJrnRM67h/j1Lol3uvswHPXglhY2SWlnwwRh7/+F7k6wFYxhfyO68ToGYymAmA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrjeeigdeflecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfg hrlhcuvffnffculdejtddmnecujfgurhepfffhvffukfhfgggtuggjsehgtderredttddv necuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesphgrqh huihgvrhdrgiihiieqnecukfhppeduuddurddutddvrddukedtrddukeehnecurfgrrhgr mhepmhgrihhlfhhrohhmpehmihgthhgrvghlsehprghquhhivghrrdighiiinecuvehluh hsthgvrhfuihiivgeptd 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 DCEB08005A; Wed, 16 Oct 2019 21:04:15 -0400 (EDT) Date: Thu, 17 Oct 2019 10:04:12 +0900 From: Michael Paquier To: Justin Pryzby Cc: Alvaro Herrera , pgsql-hackers@lists.postgresql.org, Peter Eisentraut , Andreas Karlsson Subject: Re: v12.0: segfault in reindex CONCURRENTLY Message-ID: <20191017010412.GH2602@paquier.xyz> References: <20191013181450.GG4475@telsasoft.com> <20191013191834.GA11662@alvherre.pgsql> <20191016211146.GP3599@telsasoft.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="jQIvE3yXcK9X9HBh" Content-Disposition: inline In-Reply-To: <20191016211146.GP3599@telsasoft.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --jQIvE3yXcK9X9HBh Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Oct 16, 2019 at 04:11:46PM -0500, Justin Pryzby wrote: > On Sun, Oct 13, 2019 at 04:18:34PM -0300, Alvaro Herrera wrote: >> (FWIW I expect the crash is possible not just in reindex but also in >> CREATE INDEX CONCURRENTLY.) >=20 > FWIW, for sake of list archives, and for anyone running v12 hoping to avo= id > crashing, I believe we hit this for DROP INDEX CONCURRENTLY, although I d= on't > have the backtrace to prove it. You may not have a backtrace, but I think that you are right: WaitForLockers() gets called in index_drop() with progress reporting enabled. index_drop() would also be taken by REINDEX CONCURRENTLY through performMultipleDeletions() but we cannot know if it gets used for REINDEX CONCURRENTLY or for DROP INDEX CONCURRENTLY as it goes through the central deletion machinery, so we have to mark progress reporting as true anyway. Maybe that's worth a comment in index_drop when calling WaitForLockers() because it is not actually that obvious, say like that: @@ -2157,7 +2157,10 @@ index_drop(Oid indexId, bool concurrent, bool concurrent_lock_mode) /* * Wait till every transaction that saw the old index state has - * finished. + * finished. Progress reporting is enabled here for REINDEX + * CONCURRENTLY, but not for DROP INDEX CONCURRENTLY. Track + * the progress through WaitForLockers() anyway, the information + * will not show up if using DROP INDEX CONCURRENTLY. */ WaitForLockers(heaplocktag, AccessExclusiveLock, true); Thoughts? -- Michael --jQIvE3yXcK9X9HBh Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAl2nvgwACgkQnvQgOdby QH2eww//dJB6fqtnIdV1uT3OG4V3UuNUwBhqvA685BYl/YeCiDv/VTTsNNKmwTrs 6+PyzyYSZT3YIpg3Z5d880ImqndaWy2fdg+m2BjEyRqjb1m/6LJab3zwajpE0B7d O772wdvNXGbsSGPGAF3H7KRUGXGR3P0SbOrC9uGXmcVp7m1JQ7v9706lpXA7OI4E UqGsGKWT38XEKueCeIyHH8qW+2AFw2temFVxUpkV/K8XIAQLxewuobMwan6UvvnD vJAUGCGmsO30mFF9B2gfgSG3rtpTJP1iW35UF4PPM4BuBRxHhzqx1032/meVmpe4 xoUBdFR8hOI7y7xTxoAndSZzwt4wtHIsw3+baowE9fwR5L4T2nfIwJIissEg4TSA hYcbjMYnib4v+9DlFdXkSsLwpPL2smKGCAzScTDuBNiK9rKsb8QxD5AUFP85g1jT dEGAzUogsU3ip0tHfIVKDIdrdsxWd0Arq1+3Z1Qor0lTYdsnE5c9yHth6muc+CIH HMMHyva20PRXYyeqpJmbd8vHXooMuJJxIJSQ5+9LwWiHvKA0y/H894J7Wfz/yfVb 0BfQ97CaitSePvH15/faSV9ZAW7Y/FlWMpwg/2DbewLh+zJ0tyq52h43QsFcjtWj umFEkyltwiYeR5IXCEgs9cICXchSAc3SwI6DcHP7gAPxV5F5nIU= =Jitj -----END PGP SIGNATURE----- --jQIvE3yXcK9X9HBh--