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 1w7tu1-0000Wh-1P for pgsql-hackers@arkaria.postgresql.org; Wed, 01 Apr 2026 11:38:30 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w7tu0-00H61r-0z for pgsql-hackers@arkaria.postgresql.org; Wed, 01 Apr 2026 11:38:28 +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 1w7ttz-00H61i-2H for pgsql-hackers@lists.postgresql.org; Wed, 01 Apr 2026 11:38:28 +0000 Received: from fout-b2-smtp.messagingengine.com ([202.12.124.145]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1w7ttv-000000000Kx-3wqV for pgsql-hackers@lists.postgresql.org; Wed, 01 Apr 2026 11:38:27 +0000 Received: from phl-compute-02.internal (phl-compute-02.internal [10.202.2.42]) by mailfout.stl.internal (Postfix) with ESMTP id CAA311D00336; Wed, 1 Apr 2026 07:38:20 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-02.internal (MEProxy); Wed, 01 Apr 2026 07:38:21 -0400 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=fm2; t=1775043500; x=1775129900; bh=S qVaWzFT7KSvzDQojuTxMfhY3YbViMZGQ0OrXjSrYc8=; b=G5okeZK2Vhp2K+gTc 0fZ/qd0M7KmCphcpKfXNatCTSVBVkREtv3lu6L6CtSIMqUo4VaCCnitWvVMK0EsQ t9hLN/9TcyShiDycRv6JSq5i5geRxz2Oz3Y3BOR0i6V5w3ymQ0EH1x/cKTomWhpp 5UJPZkJWdI8YaV8FWteQjYI1HCsAmLBw50HjsqQ46qHDSyslQ+ubRNoNorRs1gU/ ZeSMVekdOCAD50YBH7WRBrG6V3fF70OB5ab9uigFaeo0LYg3esK4xV+qYawFg2Ym /QWMWqgM9WuPp1dqujez1hJjfGXGMJQnWsKX7LrXla98vmkchtCoJ7IAtqr2LwLu jzAkQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefhedrtddtgdeftdduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceurghi lhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurh epfffhvfevuffkgggtugfgjgesthekredttddtjeenucfhrhhomheptehlvhgrrhhoucfj vghrrhgvrhgruceorghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgheqnecugg ftrfgrthhtvghrnhepvdektdffudfftdffffehfffhjeejhffgieeuueekjeekfffgudff hfduffffueevnecuffhomhgrihhnpegvnhhtvghrphhrihhsvggusgdrtghomhenucevlh hushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhvhhgvrhhr vgesrghlvhhhrdhnohdqihhprdhorhhgpdhnsggprhgtphhtthhopeejpdhmohguvgepsh hmthhpohhuthdprhgtphhtthhopegrhhestgihsggvrhhtvggtrdgrthdprhgtphhtthho pegrmhhithdrkhgrphhilhgrudeisehgmhgrihhlrdgtohhmpdhrtghpthhtohepsghovg hkvgifuhhrmhdophhoshhtghhrvghssehgmhgrihhlrdgtohhmpdhrtghpthhtohepmhhi hhgrihhlnhhikhgrlhgrhigvuhesghhmrghilhdrtghomhdprhgtphhtthhopehsrhhinh grthhhvddufeefsehgmhgrihhlrdgtohhmpdhrtghpthhtohepphhgshhqlhdqhhgrtghk vghrsheslhhishhtshdrphhoshhtghhrvghsqhhlrdhorhhgpdhrtghpthhtoheprhhosg esgiiiihhllhgrrdhnvght X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 1 Apr 2026 07:38:19 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alvh.no-ip.org; s=schmee; t=1775043496; bh=t95qj9RcwYtz/7rXdIx294fRFcITYLRnakWHMVvz/Vk=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=QEEIlL0hbPOeAJyJfsMKEzhhJcjhqzFYfCXVRJLarQDuxOvVEntqMofrlbkFXwVVa 3+wLW6PE9OKgZZ6SMgDxvbmbaUFtMj/GvDAmiobcS56MXqvYWyLG4vjhVq84Zq9oi7 3w7K8y6OBd0AtwFcDHffBDSq0el+ybxwt6ICjAQUkig6D9YvtuXcSGsUSTOdp16INW 4yMrIriuTwOnMyazZbDfLy52E7SOMYAmPNCilZMqCjGBZ2heKi5bkhL4rtENJ9lMbs xMjoaqvjxy8n6/tDFhiyAVFZ9XcSGDTpBGJZADqP5MUeo39ME1c8ZVMnO2YNHz7Xbd KOH/vJgDg/l1g== Received: by schmee.kurilemu.internal (Postfix, from userid 1000) id C96067C; Wed, 01 Apr 2026 13:38:16 +0200 (CEST) Date: Wed, 1 Apr 2026 13:38:16 +0200 From: Alvaro Herrera To: Amit Kapila Cc: Srinath Reddy Sadipiralla , Mihail Nikalayeu , Antonin Houska , Matthias van de Meent , Pg Hackers , Robert Treat Subject: Re: Adding REPACK [concurrently] Message-ID: <202604011050.7ya3k4ccd3hg@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 2026-Apr-01, Amit Kapila wrote: > What about if the blocking process is an autovacumm that is working to > prevent XID wraparound? I think we already avoid killing it in such > cases. If we just let REPACK finish, it will also renew the table's XID, so autovacuum is not needed in that case. I mean, there's no reason to let autovacuum process the contents of a table that is going to be replaced completely. One potentially problematic case would be that an emergency autovacuum has been running for a long time and about to finish, and REPACK is started. But in that case, autovacuum already has ShareUpdateExclusive, so REPACK wouldn't be able to start at all, which means it won't kill autovacuum. And in the case where autovacuum is doing emergency vacuuming, then it won't commit suicide, so it will be able to complete before repack starts. > BTW, one can say that cancelling a long-running report query also > wastes a lot of effort of the user generating such a report. Why can't > REPACK wait for such a select to finish instead of cancelling it? I don't understand exactly which scenario you're concerned about. Is there a long-running query which, after spending a lot of time running a report, tries to upgrade its lock level on the table? Keep in mind that this check only runs when the affected session runs the deadlock checker, which means it's been waiting to acquire a lock for deadlock_timeout seconds. It's not repack that kills the query. [ ... reflects ...] Oh, actually what Srinath proposed does exactly that -- kill other queries. Hmm, yeah, I'm less sure about that particular bit. Here I'm only talking about my proposal to have the deadlock detector handle the case of somebody waiting to lock the table. -- Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/