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.98.2) (envelope-from ) id 1xBDOX-000000034fY-2ieR for pgsql-hackers@arkaria.postgresql.org; Mon, 28 Sep 2026 15:35:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.98.2) (envelope-from ) id 1xBDOV-00000009xr6-0BQ8 for pgsql-hackers@arkaria.postgresql.org; Mon, 28 Sep 2026 15:35:55 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xBDOU-00000009xqy-2kDx for pgsql-hackers@lists.postgresql.org; Mon, 28 Sep 2026 15:35:54 +0000 Received: from fhigh-b5-smtp.messagingengine.com ([202.12.124.156]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xBDOS-00000001l73-0Bxe for pgsql-hackers@lists.postgresql.org; Mon, 28 Sep 2026 15:35:54 +0000 Received: from phl-compute-02.internal (phl-compute-02.internal [10.202.2.42]) by mailfhigh.stl.internal (Postfix) with ESMTP id 0017F7A0129; Mon, 28 Sep 2026 11:35:49 -0400 (EDT) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-02.internal (MEProxy); Mon, 28 Sep 2026 11:35:50 -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=fm3; t=1790609749; x= 1790696149; bh=1hnfdBn2JuV7Y3+Umpko4pbogHPTJlm8Po7xAGRd+JM=; b=w tyCmq4VQHHIzEsyDk9fp6UDM8CFAJujn1pSicHazXlb56zYDgYPs6fnYzh1o/hat 34+qSy8wVtAEsjH2AixXbDqD9UtDGqV3XmWwx0WgAfpJHmaPCx2hnlqG284MDrVx GPmwuMaYW+6KfhnjgjEIFLmT6pYGlxC4v0omI9SQGB+KCf2ai2ivHtsv35omEwM2 hMrTenzmL6D2z5HLIy2FHOwn9I0QSi24VuqgW4w4MRsAEOhm2XunhuEpOW3Hc+WA eGa3+bh2CzSfQESM2I4SR8nW53NDhtkVOydmZd7m50q7WITXTF4Da3QxUGons3xA JGC2hW09w/3XcgEmIlVAQ== 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=1790609749; x=1790696149; bh=1 hnfdBn2JuV7Y3+Umpko4pbogHPTJlm8Po7xAGRd+JM=; b=JexCSZWgO0mWvVgGs O9zsPgtF6g+6mJzJwxs6KuiJu6XMiyAv/UEIa/oJNox0AwHfB2hi4TAYM049yIfl mz2Rehyi8QqUhoPi2mS41g6unZuCzaeVCO38CR3jhWUlA+5NWsUm76Mls2wJSANV Wcyf0/uDbP4MHpRjql0nwVZS9J7A4qhfvlV31O6PJhDWtdAP7D1qfxRQ+jZb1IXx jjJf/ecLkSn4B4CQJJQAMNq8TdH3IERu0J2lQwBja47S+sVXRaaWA9WtpEEyzbS+ abahzxyi6+RC1RNkVOZZt5RlFkD/AqxCrmKL/pfq+MLWgrCGquZLHSu/eH0UVBBP 3JY5w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTGTLbJ5rIWEQO7IjUJwOgtpt/djedC5r24PvXNE/Stz78HhN8ZCjSax7Wss4Zw5vK 9mS4hGQ3pR6wwMKFahFUEtQXgFsS+dtB7g7VG0B9yvoRPD1JDC+7HHlY7BwqSha7MzF3d2 rMIjSWqB681KxBy+8OjE1xqoC4uhKblavCfpjwxEwNJJoOaJY1ecbNHo36xmGCjDofenoB eYZxjNX6ckvdu+MtQWz6KpzAvEWgAd29IrSfCPiAqlryHBj+dRBW/luc+rMM6sLQ+A9TwS +Y0hwJe/dYsxBnh/GTxnritmbo+V/wzijcI++0uJzUyeb5inAIS0Mr/hKneh+MtCgVKoSp hcQNY+souoldN/E0nKZsBTvJEZSppf53tEZtx0TeTRsP7M+GbegkJwAMYhiZ8KjfufreK1 gsvwI0JgeIyNrPp96xpOtG/QKX5QLDFrRNjmS0aMT86NM/JVVF6CQWtyeBDGHY/zRiGkxm c9QQHXASw2thDrgcyNhu98QSFUc4giBbEZYyW7k5zfc2JEpKHbeMSK/zm/SLZIk6Ehjzmp XHi0Aqmlgx7ir9ZlQN8azXkxsUEdcV5gLUiSebK/TENT81Le8vUe5kvmX7lS2AuTMEgoAi glSJdHNxhh/aJiKCIu5Huh+t0tGFMKmQ6VsNfS7LwdZp/APsc4d+hRgjWF6A X-ME-Proxy: Feedback-ID: ie3de48e3:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 28 Sep 2026 11:35:49 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kurilemu.de; s=schmee; t=1790609746; bh=SD6fNRUKY5SK0Ra7eNN6dZXYNeupsWqR5SsT712tznk=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=w3d6h2ZrLt1oRsg068dqN6OEyAbpe/zbgmQA1koI/EyM1DWpIh5QLlCWP0OC4PPrK GWSfg0HAzslj84YYEZilS15YhkH2JgIs1wtTOl6i4LDbBp/CC6ZOigEpPQm6occjpR W7dBEmCBa7fXrhzVIflOOj6rhOAVNwFK9ws/vt1l7kbMviMITkNmiSbBgnPfG9LEP9 X1PNyblWM5fd3+SDi3qA4MR4ve13SfYRUFpW95Tyqm2jW4E6Yzq9IxsasGeFivlq9W D7skMkTlmHTIFTkRt0DqyJXJb2UN5RFkNmN0UX4NdKi/ybLdfv/mT20Okp41RQ22Hq JPnLy0/RJtTzw== Received: by ida.kurilemu.internal (Postfix, from userid 1000) id 27501B00099; Mon, 28 Sep 2026 17:35:46 +0200 (CEST) Date: Mon, 28 Sep 2026 17:35:46 +0200 From: =?utf-8?Q?=C3=81lvaro?= Herrera To: Manu Cc: shihao zhong , Masahiko Sawada , Thom Brown , Antonin Houska , Robert Treat , pgsql-hackers@lists.postgresql.org Subject: Re: REPACK (CONCURRENTLY) can silently lose updates when the toast table is rewritten Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <179036565943.2118102.16573869613641283994@gmail.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2026-Sep-25, Manu wrote: > Hi, > > shihao zhong wrote: > > Done in v5. 0001 is Álvaro's version as one commit, with that comment > > added and a shorter commit message. 0002 fixes the decoding_ctx comment > > in copy_table_data(). > > I ran v5 through the same checks as v3, on master and on > REL_19_STABLE, where it applies cleanly. Thanks! I have pushed this. I apologize for forgetting to list reviewers in the commit message :-( But I also failed to remember in time that doing CheckRelationOidLockedByMe() doesn't actually check anything, and that it needs to be used in conjunction with Assert(). I have pushed a fix for that and wrote the "Reviewed-by" trailers there. Anyway, regarding the patch, I changed some comments a little bit more. The only change of actual significance is that I revisited my earlier idea of not touching copy_table_data: I did change the lock acquisition into an assert, when in concurrent mode. This is what Antonin had suggested back in [1], and I thought would be "not very nice", but I think I was mistaken. [1] https://postgr.es/m/4324.1790317455@localhost Regarding the deadlock when a conflicting lock on the toast table is acquired during the initial steps, I'm not too worried about it; I think it's on the spirit of "play stupid games, win you-know-what-kind-of- prizes", and it hopefully won't be too bad in practice. -- Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/ "No necesitamos banderas No reconocemos fronteras" (Jorge González)