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 1vl2dL-0066uo-2A for pgsql-hackers@arkaria.postgresql.org; Wed, 28 Jan 2026 10:18:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vl2dK-000iQc-2G for pgsql-hackers@arkaria.postgresql.org; Wed, 28 Jan 2026 10:18:47 +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 1vl2dK-000iQT-03 for pgsql-hackers@lists.postgresql.org; Wed, 28 Jan 2026 10:18:46 +0000 Received: from fout-b3-smtp.messagingengine.com ([202.12.124.146]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vl2dH-002iX9-1W for pgsql-hackers@postgresql.org; Wed, 28 Jan 2026 10:18:45 +0000 Received: from phl-compute-01.internal (phl-compute-01.internal [10.202.2.41]) by mailfout.stl.internal (Postfix) with ESMTP id C3AAC1D0010B; Wed, 28 Jan 2026 05:18:42 -0500 (EST) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-01.internal (MEProxy); Wed, 28 Jan 2026 05:18:42 -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=fm1; t=1769595522; x= 1769681922; bh=hoyus8W0EtRHhcSJ0F/OiASNhUjaR7dhMf+klWKlMBk=; b=H mSgo8g/uPMQ81SuA3NkPC70Mw3YwR+I3HS02e9i1wVExwlRTs0AAyS/Y80fbBIbI cUYimVU81pQclOmyuXBIF3CGxlSEJbfODNMx5oqjeotAA8oU85DVa4YZAuOz8jgv NfnMlnahQuTZyIEN3XvBx/3uOqpkiG0Y++V52hok7SlXc8PhExXaCJ3V0SlVhHcL Qt1mup1KIBxxWbZQnsI7dVcldIFJuxVV7sTiX5afGeyrBuAaVYoXrFoWzBBxcfYk oHGHCg4cL31+q1GAet93p3M0AFzC2qapx2ui3MnZNkuqKMPfax8B68LpPUtFlvsM yygFZRoKNMBss144pff0Q== 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=fm3; t=1769595522; x=1769681922; bh=h oyus8W0EtRHhcSJ0F/OiASNhUjaR7dhMf+klWKlMBk=; b=kJVcHAPnSAFJHRpG6 VACldk9bVPXyiVy/I6i/Pyb+Bi+IuzabY41Da4BdzyJwlFHHmldaB6LYeoayP87f HksLkZ46AMNU7nOo5T/K/G9GF9qmXkCcGWQTvxBQ7S5p+2RsbL7+cmcb+A+H5yhA 4HVIr8qx95MmhSOS/CahD1lrxHeITDbGzlTptqg+QStphGDxsE+baxU+j4NdGqXo T6g2ERCCn8FpUkrcTERtMTwvb/VSLeRIWnMwWd6/7Vxy+spNpst/YqMetoQKsEc+ T0+6m2RN861/heI8jND+6E5ELBbEahKPKZglvzu9VTxCOG9SGGaGJ68tKU8nyRvj dSvkg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgdduieefudduucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepfffhvfevuffkgggtugfgjgesthekredttddtjeenucfhrhhomheplmhlvhgrrhho ucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsehkuhhrihhlvghmuhdruggvqeenucggtf frrghtthgvrhhnpeetuedvheffkeevgfeuheevteevkefggedttdeufeeuheduuddthfef fffhjeefffenucffohhmrghinhepvghnthgvrhhprhhishgvuggsrdgtohhmnecuvehluh hsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghlvhhhvghrrhgv sehkuhhrihhlvghmuhdruggvpdhnsggprhgtphhtthhopeehpdhmohguvgepshhmthhpoh huthdprhgtphhtthhopegvgigtlhhushhiohhnsehgmhgrihhlrdgtohhmpdhrtghpthht ohepmhhihhgrihhlnhhikhgrlhgrhigvuhesghhmrghilhdrtghomhdprhgtphhtthhope hnohgrhheslhgvrggusghorghtrdgtohhmpdhrtghpthhtohepmhhitghhrggvlhesphgr qhhuihgvrhdrgiihiidprhgtphhtthhopehpghhsqhhlqdhhrggtkhgvrhhssehpohhsth hgrhgvshhqlhdrohhrgh X-ME-Proxy: Feedback-ID: ie3de48e3:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 28 Jan 2026 05:18:41 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kurilemu.de; s=schmee; t=1769595520; bh=F8OfyKUSjaiMuHu35ThYlUCnY6Cz2f1ZNUhQDy1oJsw=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=ogUb8IFsg8YusBTUplGRA787BIinQpGZsSrYREu6fCwIIcZAenLWqNukYlPSqdVIS VcoiHTD6NdybIdWlhnTk2WzvBi1k3PTAeiCgFn1xOYrZUBw2m/s/6TN5u6ww7hBMOa K3xaOsmhh4D5Xn2SBo0rTYbtcVVFYMemTc0Suu72YYeSb6FQts0vHgV1pNASO7r1Dj NfzRNTnWCPkjKMU3jobUs2vdqpe0R5Ip4aViP3PPvdFm3g8EiLjLDiEYAP+jA5h4SV gyQwdkKYo/A8dExf0P2vpcVLFDFPEFvWFP55EVTgaHe55uOQiCdozMHCS4jyZl7N9m HbB7fb7ZNq1sg== Received: by schmee.kurilemu.internal (Postfix, from userid 1000) id 210F27A; Wed, 28 Jan 2026 11:18:40 +0100 (CET) Date: Wed, 28 Jan 2026 11:18:40 +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: <202601281011.b6pvqpm4q5kn@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 Hello, On 2026-Jan-28, Mihail Nikalayeu wrote: > > Actually, about this fragment ... if we track these ancestors for all > > indexes, not just the ones that we consider as arbiters, don't we risk > > doing something stupid when a completely unrelated index is being > > reindexed? Namely, also consider that unrelated index as arbiter. > > Yes, such a thing may happen. It will not cause any error, because such an > index will be used as artiber only if another compatible index in that same > relation is present. And additional_arbiters will be incremented. > Probably you think linitial() is "root", but it is an immediate parent. Okay, this sounds good. Yes, I was thinking the linitial() was the root, but a quick visit to get_partition_ancestors() clearly shows that I was wrong. > I am not sure I understood you correctly, but I added a comment about it. > And about the opposite race + assert (not sure we need to keep it). Interesting. Actually, I think you're wrong on this, because an OID wraparound could happen such that the old index has a high-numbered OID, and the reindexed one has a lower one. (This is not so preposterous as it sounds, because the old index could have been created months ago, and the counter recently wrapped around.) I don't know if we can find a way to order the index list to prevent this problem. -- Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/ "Cómo ponemos nuestros dedos en la arcilla del otro. Eso es la amistad; jugar al alfarero y ver qué formas se pueden sacar del otro" (C. Halloway en La Feria de las Tinieblas, R. Bradbury)