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 1vSLz2-00CgEg-13 for pgsql-hackers@arkaria.postgresql.org; Sun, 07 Dec 2025 21:07:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vSLyz-00DvV0-0Y for pgsql-hackers@arkaria.postgresql.org; Sun, 07 Dec 2025 21:07:53 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vSLyy-00DvUs-0k for pgsql-hackers@lists.postgresql.org; Sun, 07 Dec 2025 21:07:53 +0000 Received: from fout-b6-smtp.messagingengine.com ([202.12.124.149]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vSLyv-003eAt-0W for pgsql-hackers@postgresql.org; Sun, 07 Dec 2025 21:07:51 +0000 Received: from phl-compute-01.internal (phl-compute-01.internal [10.202.2.41]) by mailfout.stl.internal (Postfix) with ESMTP id 486321D00195; Sun, 7 Dec 2025 16:07:48 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-01.internal (MEProxy); Sun, 07 Dec 2025 16:07:48 -0500 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=1765141668; x= 1765228068; bh=/wj7qsqoF9aWnlCYCjsdky4xqfbiKSNrU55eLWSdJ6o=; b=d bhb8BuqLw6BnNFcRwEUP+0Ego8/Vk2yLi3szcZvzJDxnljs+LqjyAtbE25rTTpps 3v5hCnqPSGYs7+q80pxn1Q3kz25ANbsTXeMhGOf+jFWg+00y0EZUp+djTeJnSHac Gmm2sFpNFYjjfbvvoEmVK+t+2PCgBpAKQhUfPS5N1OXD2enRBzmwx2R1/cnEz4Cd e1yz0CkzH57JHsBGg2LAEowi3qH8bfUv94lsaRCo9EUu99q7LA5aS9wQAC01WT9i 9jGzUEgXGu79EGXQXGeezLQCgwfyyRKyLpbwWyGRpdl5SrnAlCl4QFIYGB1lW8t0 He9+q2F/4ZvBwp5s/k0Eg== 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=1765141668; x=1765228068; bh=/ wj7qsqoF9aWnlCYCjsdky4xqfbiKSNrU55eLWSdJ6o=; b=sO1YJFwIts7aN1w0b AgQ38JCgvzxHA2vElwSCNoGKRhvNbch1tlDfk8jbRP2x53rCAgu3V0z1VBu0KLYf tjNXCSgLXSQDBWkDSUkCYJ9hPtjJTOsy57YebD0kWVYNSEVQY975U9Vfdc2pE+Mp MXzWgQS5zvbblPD4eoMdUee5LvMhF8SYB+rdFeicWV1npYG/gr7ultRRrgRavmG+ 3gW+W4mYtAY1JIRwvqIoyTCRJ6W00EfMijam3NM39opi4D70cS4/rj9YoumcBYWC 2oiGCfPa0toTzi2+Xr3m0L65Alj8DyWnITkyBcCVOrTYnF1ROuCe8MbollKs4niX KAlBA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgddugeekgecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpeffhffvvefukfggtggugfgjsehtkeertddttdejnecuhfhrohhmpemllhhvrghrohcu jfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgeskhhurhhilhgvmhhurdguvgeqnecuggftrf grthhtvghrnhepteeuvdehffekvefgueehveetveekgfegtddtueefueehuddutdfhfeff hfejfeffnecuffhomhgrihhnpegvnhhtvghrphhrihhsvggusgdrtghomhenucevlhhush htvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhvhhgvrhhrvges khhurhhilhgvmhhurdguvgdpnhgspghrtghpthhtohephedpmhhouggvpehsmhhtphhouh htpdhrtghpthhtohepvgigtghluhhsihhonhesghhmrghilhdrtghomhdprhgtphhtthho pehmihhhrghilhhnihhkrghlrgihvghusehgmhgrihhlrdgtohhmpdhrtghpthhtohepnh horghhsehlvggruggsohgrthdrtghomhdprhgtphhtthhopehmihgthhgrvghlsehprghq uhhivghrrdighiiipdhrtghpthhtohepphhgshhqlhdqhhgrtghkvghrshesphhoshhtgh hrvghsqhhlrdhorhhg X-ME-Proxy: Feedback-ID: ie3de48e3:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 7 Dec 2025 16:07:47 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kurilemu.de; s=schmee; t=1765141665; bh=WS9Fo+cTDfTvdq3567fsnJ5PN/vPklNj9Hx+fxdaT7k=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=SiqxZnv7q8kRP4uDA1qU3oMbMLIONgMHsWxbTzxZf9xcApk2XDOaHzEyLpya6TNSB HtUAeh7or/BpAbJRGuvUdmcu+TntQp7mbXxJYDE9S+0VOWV9/9wIoBUQ0Y2+R81P2W XEdx96OWjr3YeS6D9dfQDclGdgzZ511szGW6AgDgRpvqBpPc3ixbfCqgu1DeKgDqn0 IZ/Hsd+weOUbSpIt5sSiO8gXrbi+rZwy+0z6kxnWvmsLa6bEn8Uulohr8zH8flUwty BcZNGXQ9RBv1BUKDYF2Dz8ysHlGJ/cqDDfqMqnSf0vghrneAHWSgHS40M1sS12Wcu/ +nwufkJ8Lb6uw== Received: by schmee.kurilemu.internal (Postfix, from userid 1000) id 868AC7B; Sun, 07 Dec 2025 22:07:45 +0100 (CET) Date: Sun, 7 Dec 2025 22:07:45 +0100 From: =?utf-8?Q?=C3=81lvaro?= Herrera To: Mihail Nikalayeu Cc: Alexander Lakhin , Michael Paquier , Noah Misch , PostgreSQL Hackers Subject: Re: Issues with ON CONFLICT UPDATE and REINDEX CONCURRENTLY Message-ID: <202512072050.hcyysny65ugj@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 2025-Dec-06, Mihail Nikalayeu wrote: > Such commands add an indisready, but not indisvalid index on pt, which > is added to to the list of potential arbiters. > It happens because of [0]. > > From my perspective, the correct solution - is to just remove the > error message, because it looks obsolete now. Or somehow calculate > compensation offset differently - but I am not sure it is a good idea. Hmm, as I recall it's quite intentional that the index on a partitioned table is marked !indisvalid; such indexes are only supposed to be marked valid once indexes on all partitions have been attached. As I recall, if you remove that prohibition, some pg_dump scenarios fail. I'd rather consider the idea of avoiding indexes marked !indisvalid on partitioned tables as arbiter lists ... but then we need to verify the scenario where there is one, and INSERT ON CONFLICT runs concurrently with ALTER INDEX ATTACH PARTITION for the last partition lacking the index (which is the point where the index is marked indisvalid on the partitioned table). There may not be a problem with that, because we grab AccessExclusiveLock on the index partition, so no query can be running concurrently ... unless the INSERT is targeting a partition other than the one where the index is being attached. (On the partitioned table and index, we only have ShareUpdateExclusiveLock). -- Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/ "Crear es tan difícil como ser libre" (Elsa Triolet)