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 1wAqTD-000RkB-0Z for pgsql-hackers@arkaria.postgresql.org; Thu, 09 Apr 2026 14:34:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wAqTB-0063x1-1S for pgsql-hackers@arkaria.postgresql.org; Thu, 09 Apr 2026 14:34:58 +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.96) (envelope-from ) id 1wAqTB-0063ws-0V for pgsql-hackers@lists.postgresql.org; Thu, 09 Apr 2026 14:34:58 +0000 Received: from fhigh-b2-smtp.messagingengine.com ([202.12.124.153]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wAqT9-00000000C9i-2fmX for pgsql-hackers@lists.postgresql.org; Thu, 09 Apr 2026 14:34:57 +0000 Received: from phl-compute-05.internal (phl-compute-05.internal [10.202.2.45]) by mailfhigh.stl.internal (Postfix) with ESMTP id 23FEA7A01C3; Thu, 9 Apr 2026 10:34:53 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-05.internal (MEProxy); Thu, 09 Apr 2026 10:34:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.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 :references:reply-to:subject:subject:to:to; s=fm2; t=1775745293; x=1775831693; bh=mfLtnv+iGViK6pzkMzeketJu3qr+BdXcD49r4nflG8A=; b= gAfM8PPaqMZCwtislXZTIf9Ux1KlV6455KmL73j5EHKi4qTTub7rEhaRKM+4+UqZ 3T0HI4Cm3/e1jYtbR0Z7VTH0Q5hy6L/ozF2i7bFoSefzv3K/g0BDMbABX1v3x56J ZFk7mjDMM0tXdzylIaQDgbKh9WEbSr3htvtueHxTY+EtOzn/M3zI50Ml510HRdPB oBmv8klfN+vwhn8TzGze5qdMUCdtPovDz+EBfGRDLmodtKDVTasfSqTmHExC23LV KkikYsPBnJGMFHWRiSHDT1d750AnAUaxdBbbWFSm8Uk2Dc3rzmAOzruMiTt99SHQ NLed+pBwvhwWFHvZW4HpJw== 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 :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1775745293; x= 1775831693; bh=mfLtnv+iGViK6pzkMzeketJu3qr+BdXcD49r4nflG8A=; b=A kRpHhsjy/3dBQ7/yNQbCiSkBiN1yCXeHwUDULqBd7WCBe76BGx1WUH+yhPJKUyQP DvUoL5MmmmQdEK880g3a++q4Tha4So08zWgC4JEpIE9fZM5TzTQaDC6fVPIM9LGt fv+wo62XCeLc1yzX47FwZrE1vdo6WS1CRwbAEEuba+tHtFQ9wd0gfBPB/j63QyFG /bu3A1ESyDFa3lkBy2WrRSE7G5YSXMSZvm2OOz51FZaBKgo5NrLwkWxAHDt6ojqy fTfSR6IcV1XwHwdHfzEXqfk+aJGLqpaj/u7j0SuGroc+KbDG+of9NF9hQ5s69o5C apAXABQU6CMdvClXE5JCA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefhedrtddtgddvieejfecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpeffhffvvefukfhfgggtugfgjgestheksfdttddtjeenucfhrhhomheptehnughrvghs ucfhrhgvuhhnugcuoegrnhgurhgvshesrghnrghrrgiivghlrdguvgeqnecuggftrfgrth htvghrnhepleeugfeugeefvedvtddttdeigeevleektefgueehhfdvhfeuteduhefhtdfg gfeinecuffhomhgrihhnpehpohhsthhgrhdrvghsnecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehmrghilhhfrhhomheprghnughrvghssegrnhgrrhgriigvlhdruggv pdhnsggprhgtphhtthhopeekpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopegrlh hvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhgpdhrtghpthhtoheprghhsegthigs vghrthgvtgdrrghtpdhrtghpthhtoheprghmihhtrdhkrghpihhlrgduieesghhmrghilh drtghomhdprhgtphhtthhopegsohgvkhgvfihurhhmodhpohhsthhgrhgvshesghhmrghi lhdrtghomhdprhgtphhtthhopehmihhhrghilhhnihhkrghlrgihvghusehgmhgrihhlrd gtohhmpdhrtghpthhtohepshhrihhnrghthhdvudeffeesghhmrghilhdrtghomhdprhgt phhtthhopehpghhsqhhlqdhhrggtkhgvrhhssehlihhsthhsrdhpohhsthhgrhgvshhqlh drohhrghdprhgtphhtthhopehrohgsseigiihilhhlrgdrnhgvth X-ME-Proxy: Feedback-ID: id4a34324:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 9 Apr 2026 10:34:53 -0400 (EDT) Date: Thu, 9 Apr 2026 10:34:52 -0400 From: Andres Freund To: Mihail Nikalayeu Cc: Antonin Houska , Amit Kapila , Alvaro Herrera , Srinath Reddy Sadipiralla , Matthias van de Meent , Pg Hackers , Robert Treat Subject: Re: Adding REPACK [concurrently] Message-ID: References: <4n4q3preb3lgyhpzstebhux7b2aojhsw7gik4ivaznyggiezrs@lrznutssxlh2> <9539.1775724194@localhost> <10697.1775726789@localhost> 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 Hi, On 2026-04-09 10:26:22 -0400, Andres Freund wrote: > On 2026-04-09 16:06:17 +0200, Mihail Nikalayeu wrote: > > On Thu, Apr 9, 2026 at 11:26 AM Antonin Houska wrote: > > > Sure, it's possible, but IMO the principal question is whether REPACK should > > > let VACUUM and DDLs error out, or just let them wait. > > > > One more idea: instead of ERROR in CheckTableNotInUse in case of > > in_repack - just release the lock and retry a little later (by that > > time, the repack operation will likely have acquired the AEL). > > I continue to think this approach has no chance of working. Even if it > theoretically could, there are lots of paths to locking relations that do not > go through CheckTableNotInUse(), and we're not going to just route them all > through CheckTableNotInUse(). > > What CheckTableNotInUse() is for is to prevent DDL from changing the structure > of the table when it is still being referred to. You can't just call > CheckTableNotInUse() from a LOCK TABLE - it would trigger wrong errors *ALL > THE TIME* because a LOCK TABLE does not need to error out just because there's > also a cursor on the table. > > > And it'd trigger lots of bogus errors. See the first example in > https://postgr.es/m/fpr4nsmyy3mpfrm2mijspr44dgol2cjeke5tyznb4btsznxsgx%40iifdbfe2wl63 > > S2 would get the lock and then error out due to the proposed check. Even > though there's no need for it. Before you protest that you could just let the non-DDL operation have its lock, sure, but that's an utterly terrible idea, because it will lead to more and more work accumulating that then has to happen when the AEL is actually held. Greetings, Andres Freund