Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1x6V7e-000H26-0j for pgsql-hackers@arkaria.postgresql.org; Tue, 15 Sep 2026 15:31:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1x6V7d-002VAi-1A for pgsql-hackers@arkaria.postgresql.org; Tue, 15 Sep 2026 15:31:01 +0000 Received: from makus.postgresql.org ([72.32.157.229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1x6V7c-002VAA-2e; Tue, 15 Sep 2026 15:31:01 +0000 Received: from fhigh-b8-smtp.messagingengine.com ([202.12.124.159]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1x6V7a-00000000D6h-3ZdQ; Tue, 15 Sep 2026 15:30:59 +0000 Received: from phl-compute-05.internal (phl-compute-05.internal [10.202.2.45]) by mailfhigh.stl.internal (Postfix) with ESMTP id 0AA4F7A0228; Tue, 15 Sep 2026 11:30:58 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-05.internal (MEProxy); Tue, 15 Sep 2026 11:30:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kurilemu.de; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :reply-to:subject:subject:to:to; s=fm2; t=1789486257; x= 1789572657; bh=mwrnhZF02zKicklomqxdrIbCWxZWk98/TZBCFr7gUOs=; b=T HzpZsf8tkRM5pFYDuPEr7mr9ZQ/4hoVeMYQU86NZdD9WxlAc/uxEe7TPzyIu10bs YJnmomcfnhxz/bWqtdoXjTF0R4JkGGTyL0AKmdGaeLBo3fwOsas/MAC0/URDhqhB Puzwm3COsbv9unI+ECW6FEBBVMpE+VB94vzyYMYdOCVugJrJLAm5IoTupWCrnwP9 oksUtLUWKd7xB3xh8SsX+YEUI38MqDX5icQOHpW6HhXRwmxtZvmess2TJYf658ZA ItM0JlOLf4GdbR80VX/8cWpMOc98y3KJIkRUM6w/i/RHY0XuSzKXflbg6TDeOzqZ amSGpmVHNEU7JH178Zp0Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; t=1789486257; x=1789572657; bh=m wrnhZF02zKicklomqxdrIbCWxZWk98/TZBCFr7gUOs=; b=P75Gffbz2IG36ypHk VfMW9fqCp75m2cHK7I/8gsRhAUDFpIdX9GPlQolopT6CTCvkj9Grz6GTqoo896lJ 893VMzElsSJAWotcbpTjhojRYR3/34u3W21k12UWz0ubJLvEPnpdOpBzino640Dr 8hIRmA3G72n6Xm+vO34KTyeNCtOKtp5GKxnPkLQkPJS1KVPcImkm01jlYhX43LfL kRLos4HM3NP8791/EhWR1FLELgOuuuQCeV3lU85kG96WiqgS/O0EC2byvx8wAWsd eb+OIfIlTOUyUCrJeE8sXHMMOLxVdy7joc9JloZB0XjF2df1mtPGgv17m24QMBHk fMpvQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTFC/EPks2IQmlCduyNuqGkxrlAc309leNKS3DOBAtrZW+y0LFgKoC8yygYBXnhddO kjYAoBOUk5nGSPso3dgy8POQcEvYFiNPpOYaVCMjbvFHpT0c4Q2X0iV6WAtmHNOQrxEkOr 7C455u85mlFhyGkoLPiarYuH8qJ24iFGWZksLmrepkuuKkHF8TcNTY8m4Hqy2bLkeyFHwz 2tJ2nXqrUdDE4U0r3vXHBfN9nIKkDEMXcIiwwvKpqIhbCLW5tH1af7polnHtdS0z7Pn4GA lDBDKg82MTLfV9bMR3wqQzvqpBeZaBSEjr26UcMTHh8iiIkejzE0/tjelWBC2bdT9ccdlt 84nO+in6mtkQUeLBzHzyyL/FsqiJOBtpqKsqHcPwjI+PhA8HxJYnEyuVVtPwl5UY2sZBui 3lj4+suU9hme2mnGEPtjzID+atBa8xDNd6YUYuoAwRqVtFS4XJpyi44otqr9vKmH1ljdoT KfEkMv9roe8iD+7ck6euDmvO+qROphFjb/8xkQ58zasxH1uCwqT6tJCWUIGOWI5n/4MSMB em/o5OKLrzg+XPM13bzMtM6WznevJEA9Lbgv7bOqZsL5vjCOoeits3AFyUznUNjknDPOQu aITPQ9E/dC/ojVcdUHFy+j0Aq8Wupd982ugQRgdQt4ius9tbp0+aO711q5/A X-ME-Proxy: Feedback-ID: ie3de48e3:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 15 Sep 2026 11:30:57 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kurilemu.de; s=schmee; t=1789486254; bh=q+O/IJ0amoAgLSv/mxlnxjuoOJlsIJGyyI/c7QWnK2Q=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=CSLhSChnRit6bE2RvtvY6TlYyJNVcjBpN5gd1ijmTtlUPz62Mjd6MPKmX+zjIqvGN t7ofQHv1VxziaewT2no9oTFPcYZZ0k0Md0ORjMl04D9sw9Je7t/cgiNThQl5KV5uzL /KHL5iGEofT64nFY9J6MNT1bmy6M6TeE2b8SPxxbg3hXXsSdS6KKpEb0481cqhc2Ua i64YIo2s7EDwJjLk/qd5lN9ISMa0eU6apYP3Q5os73qsHrTRHkpnn2GLdzQd7nE/MU fIO5NiIW00jAr0IHrWdpIw9PhHLh1jquf9lbPVsh/yKgBEris+MPDInNO2sVT4TbT1 3VkDetfbl2boA== Received: by ida.kurilemu.internal (Postfix, from userid 1000) id D0213B002DE; Tue, 15 Sep 2026 17:30:54 +0200 (CEST) Date: Tue, 15 Sep 2026 17:30:54 +0200 From: =?utf-8?Q?=C3=81lvaro?= Herrera To: Robert Treat Cc: shihao zhong , Zsolt Parragi , Christophe Pettus , pgsql-hackers@lists.postgresql.org, Kyotaro Horiguchi , rmt@lists.postgresql.org Subject: Re: REPACK (CONCURRENTLY) doesn't handle invalid indexes Message-ID: 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 2026-Sep-14, Robert Treat wrote: > The patch looks right to me, and I think I am +1 for this generally, > though I would note that we are widening the scope here such that > indexes that could succeed with a rebuild would now cause an error, so > we're a little less functional though a little more behaviorally > consistent. Yeah. I considered the idea of adding a REPACK option like "rebuild_invalid_indexes=on" that would attempt to rebuild rather than failing outright, at the user's risk. Not sure it's worth the trouble. I have pushed this change now, without the test. I did throw in a short doc update. One thing I didn't want to say in said doc update, is that while you can do a REINDEX of the non-validated index prior to REPACK, it's rather a complete waste of time, because REPACK has to rebuild that index again. It's probably better to DROP the index, then REPACK, then do CREATE INDEX CONCURRENTLY. If we didn't cause REPACK to error out in the presence of a buildable invalid index, then REPACK could rebuild the index just fine. I'm happy to listen to your operationally-experienced opinion on this. > This does feel hacky, since we're being manipulative rather than > testing a real scenario. Yeah. > I think what we want would be to follow the lead of > src/test/modules/injection_points/sql/reindex_conc.sql? Do you mean creating test invalid indexes by way of using injection points to interrupt creation in the various phases? I don't see reindex_conc.sql doing that. But also, we run these tests in test_decoding because it's the test suite that is certain to have wal_level=logical; but if we wanted to also require injection_points, the changes in meson.build / Makefile get more involved. I didn't find a test suite that has conditional tests depending on injection_points. src/test/modules/authentication does, but for a TAP test, not a plain regress or isolation test. It is surely just a SMOP ... -- Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/ “Cuando no hay humildad las personas se degradan” (A. Christie)