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 1nvy1v-000122-H1 for pgsql-bugs@arkaria.postgresql.org; Tue, 31 May 2022 09:19:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nvy1u-0001T7-DF for pgsql-bugs@arkaria.postgresql.org; Tue, 31 May 2022 09:19:10 +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 1nvy1u-0001Sy-4n for pgsql-bugs@lists.postgresql.org; Tue, 31 May 2022 09:19:10 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nvy1r-0006ZI-7n for pgsql-bugs@lists.postgresql.org; Tue, 31 May 2022 09:19:09 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 456F05C017D; Tue, 31 May 2022 05:19:04 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Tue, 31 May 2022 05:19:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version: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=1653988744; x=1654075144; bh=A uxJe0VfhkpzQf0xpbxM6dlm/vXKbAHQsYITlbCMJR0=; b=qNV5rnDPEfIRGf+Tg Q+jOXHY4bIKhB4dYm8j19IOz8FJLYvJI6anqpxczYt5XycL+IOJLMvRlolKdBVrz DqKDHSIXWZgzvx3rJ+3TfVWg8EX0IkDCzzJshGEugavScvDqFzZChzlXFn9b8P3G +6kIW6Zcyl8xyvnSQLcBlvmZLeZaS5PDprWf7LAJtK73Wdz1UVPDWOWA7yuI5R5s +4EJb39NviOkiKH+Thz6Jxnkl0qvcsQ2VIfZahZE63oh/ME7P5YSREvH3lVUb7cw FyiyGw/7dR/48fIJShIiVGzKMFq1mAP4yOOpEh6Wv8mlINdCN6oZjXbJMJIh+ooa zBeXg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrkeekgdduhecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvvefukfggtggugfgjsehtkeertddttdejnecuhfhrohhmpeetlhhvrghr ohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhgqe enucggtffrrghtthgvrhhnpeeuiefgffeukedtgfetueeugfetvdeuhefgheelfeehleej leefffejtddtkedvjeenucffohhmrghinhepphhoshhtghhrrdgvshdpvghnthgvrhhprh hishgvuggsrdgtohhmnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghi lhhfrhhomheprghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 31 May 2022 05:19:03 -0400 (EDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id D1D762A0843; Tue, 31 May 2022 11:19:01 +0200 (CEST) Date: Tue, 31 May 2022 11:19:01 +0200 From: Alvaro Herrera To: Michael Paquier Cc: Andres Freund , Andrey Borodin , Robert Haas , Peter Geoghegan , =?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: <202205310919.ziwjdn5e36nt@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2022-May-31, Michael Paquier wrote: > Yeah, the tricky part is how to parametize that to be cheap, still > useful. Having a larger number of attributes makes the particular > problem of this thread easier to hit because it enlarges the > validation window in the concurrent build, Hmm, I wonder if it's possible to use an index ON tab (pg_sleep(100ms)) or something like that (perhaps even use an expresion involving an advisory lock acquisition, which is being held by the other session), to widen the window. The stop events patch that A. Korotkov posted [0] would likely be very useful here. [0] https://postgr.es/m/CAPpHfdtSEOHX8dSk9Qp+Z++i4BGQoffKip6JDWngEA+g7Z-XmQ@mail.gmail.com > On my own laptop, the original test of the reporter takes up to 3~4s > to reproduce the issue, for example, all the time, so that's good :) Sadly, my laptop is somehow broken and I haven't reproduced the failure even a single time, and my other regular computers are at high seas (I hope). -- Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/