Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ntJ2V-0002gK-Kr for pgsql-bugs@arkaria.postgresql.org; Tue, 24 May 2022 01:08:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ntJ2T-0000cq-C6 for pgsql-bugs@arkaria.postgresql.org; Tue, 24 May 2022 01:08:45 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ntJ2R-0000Zd-Px for pgsql-bugs@lists.postgresql.org; Tue, 24 May 2022 01:08:45 +0000 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ntJ2O-0002jF-EU for pgsql-bugs@lists.postgresql.org; Tue, 24 May 2022 01:08:43 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id D0FA532004F8; Mon, 23 May 2022 21:08:36 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Mon, 23 May 2022 21:08:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm1; t=1653354516; x=1653440916; bh=New0Z3essQ FasvZEb3lqg6zOikqpQkr3yafPiVOSHVI=; b=wKLvGddkLnvTsVAQ0lAzUErr/+ nzc7An+rhXd52SDM+9tXGJEG/6Q2REMAOXukD08v+H7xETzqMlPDA9oHvDedclqE YXLF27yDR/Xvi7PmpL2RV/HSAkiml+kYNwbtDAr3Mmva3WOLc1ITP7fvxvAiQDTE qq87cUsphqhTPJ6SBZgHpeBEotAQhp/Hhv5wLem1RgaWdO9MA8ZPNaec0OS+3ebn gK9ydy0LtMDiOLNKVxqAkm+oImPqHnBXdaKwEVqPTj7fkbBfL7iwYvruz4JVJrFE xA71ZgD9Bfd3UMG+5Or8ZGcyaI8OEyC3cVd+aHuZ74KFqfQhY/3zikokiJiQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1653354516; x=1653440916; bh=New0Z3essQFasvZEb3lqg6zOikqp Qkr3yafPiVOSHVI=; b=lSaf3NvoXd52JrigA3X0UXvLBy/zlUqQwiu9up6VuKV3 5Flex+uYQZC5z1IHJZWcbu03bgvL5yFoz6Q0TaEftEj0NGW2BDI7nI0Bba5WwkD3 c5nlEdDzzSndrA1y2/xGZVt8Uh2kYkad7Kg8y8LIjmL0PBDuHL3nH5Jw2o0AzZhM ekZ++mcST1A35AyePUogzmNfXjwcRcoTM1+Eh4YZ5m+Al+l+Kmt+5ohmYqYTXIxt 9YuxyCxybM6tovfdRnaC3oN2Z+BOIALv/blI6nNj0vmciPAqUgwjMQ5ycYeiQe3C t20XsAQ5T1Rxz1hjKwzbep1uEwTkcrukWhzD+TaOwQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrjedvgdeggecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfg hrlhcuvffnffculdejtddmnecujfgurhepfffhvfevuffkfhggtggujgesghdtreertddt vdenucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprg hquhhivghrrdighiiiqeenucggtffrrghtthgvrhhnpeetleeifedufffhhfdtteelgeeg geffhfekueevteeigfduudevudetgfegiedvjeenucevlhhushhtvghrufhiiigvpedtne curfgrrhgrmhepmhgrihhlfhhrohhmpehmihgthhgrvghlsehprghquhhivghrrdighiii X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 23 May 2022 21:08:34 -0400 (EDT) Date: Tue, 24 May 2022 10:08:29 +0900 From: Michael Paquier To: Alvaro Herrera Cc: =?utf-8?B?0J/QtdGC0YrRgCDQodC70LDQstC+0LI=?= , PostgreSQL mailing lists Subject: Re: BUG #17485: Records missing from Primary Key index when doing REINDEX INDEX CONCURRENTLY Message-ID: References: <202205230807.jk6lmduxyi3z@alvherre.pgsql> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="qWq1VxpcLu2fkMqG" Content-Disposition: inline In-Reply-To: <202205230807.jk6lmduxyi3z@alvherre.pgsql> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --qWq1VxpcLu2fkMqG Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, May 23, 2022 at 10:07:44AM +0200, Alvaro Herrera wrote: > I think if this is a big enough deal (and I think it may be) then IMO we > should revert as you suggest, make an out-of-schedule release, and then > I can take some time to investigate in more depth and see if the feature > can be salvaged.=20 >=20 > OTOH if we think an out-of-schedule release is not warranted, then > reverting right now is not useful; we can make a decision about that > closer to the next minor release, once we've had time to see if the bug > can be fixed in some other way that doesn't break the whole feature. The annoying part is that this can cause silent corruptions for indexes created with REINDEX and CIC, so most users won't know about the failure until they see that their application is broken. And we are just talking about a btree index here, other index AMs may be similarly impacted. So that's rather bad IMHO :/ It seems to me that the problem is around the wait phase after the validation, where the computation of limitXmin coming from the snapshot used for the validation ignores now the impact of VACUUM, hence impacting the timing when the index can be safely used. It also looks like it is possible to build an isolation test, where we use a transaction with a snapshot older than the REINDEX to force it to wait in the first WaitForOlderSnapshots() call. -- Michael --qWq1VxpcLu2fkMqG Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmKMMA0ACgkQnvQgOdby QH22DA/6AiOt2XXow2d6oJxgpPDLDo+nanYR8BmZGt2DC3bpbCWTRNAf0TodEsa9 R1DuWaAfWR18CQsomBhdChZF86866moHLSg3skgiM2X+4RWm6MkDb+BxvGpLX8ie sU1+tFpG6Scuxm2Q1jF5eqr7vxkYQRfAxc1O1qjXPHtd+PvSa8mpFyJVFq1E+n/h Nv5qtjPf/HLu/8odsUza1j3yFhXYT0XbXh6n0Z+tSQYzsk78kCjX9ut5g6tzMBUs 169VkD6f2A6RMESy3zpVN1oqt31qAjakuluMYc6lIRauYwQQYpNqY62AWdHUlHyv UBmQL+3hNRj9Et5XLF9PcfbFQG6c2GWNXaXRVu18OPReGzsNW14nGZPZDFmnbjzk arp+tVWvs5xGqYiJNIpSI75Ye1aYjOiE8ngVg9YUBV1mtGyajyi1efbyFBnv4fjU I1V+PwZH4aYsBtDRgUzDuP4OtQD3VMYkp0mR+P9vExyCYXqBwuYk+L2ook34AlVj +RdCzH3GoZ4hUNK1BFhxZTt7WLApVgpJgKykQYbQoiMc7JiJqcgnncy75j4GTOe9 RY6Dt3T9oGihb4uhJayKS+EGFSUpWY/Lpsk7+QyBS4NqqAD41pTefAYQuz2+Ps0B 2QFGt8Rw0dx4bqWMq8XrkgAlE8olWQLKTlqcXnxyOdztx64jyEM= =6J3D -----END PGP SIGNATURE----- --qWq1VxpcLu2fkMqG--