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.94.2) (envelope-from ) id 1vEbtP-00EAh2-FP for pgsql-hackers@arkaria.postgresql.org; Thu, 30 Oct 2025 23:17:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1vEbtO-00B3nu-CW for pgsql-hackers@arkaria.postgresql.org; Thu, 30 Oct 2025 23:17:17 +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.94.2) (envelope-from ) id 1vEbtN-00B3nl-No for pgsql-hackers@lists.postgresql.org; Thu, 30 Oct 2025 23:17:16 +0000 Received: from fout-b8-smtp.messagingengine.com ([202.12.124.151]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vEbtI-0059D5-0I for pgsql-hackers@lists.postgresql.org; Thu, 30 Oct 2025 23:17:16 +0000 Received: from phl-compute-03.internal (phl-compute-03.internal [10.202.2.43]) by mailfout.stl.internal (Postfix) with ESMTP id A01D31D00054; Thu, 30 Oct 2025 19:17:09 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-03.internal (MEProxy); Thu, 30 Oct 2025 19:17:09 -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=fm3; t=1761866229; x=1761952629; bh=A RGB9vlASRxvwFVlSsqfiZQFC7SBXqz4RL/eDJt1Izo=; b=FE+CBrBBdFtxvCJ+F m6Urmcaj7cb/c7sFFX5XZaPztZyl9oauS8kZmT8j5+lmJuaPeFbL6LC5MmJurYL3 o1Yparwkvo55qXXPks4Fegii2a6Jf7r5VO1h8mjwUYwONlOyXvv2+OFFokjF4oSU +9RLa7wBztWGvs3w304v92f9HcERaWvtqS1D8jvUcz9yKqXZhQiPbQNa2QEgIh5Y 5+JMmJ5yCgHjx6xv4Mr2d/Oq4MTroXfkxLiRut0rYbB58hwHGfBR4lH5ahsTyhdK D89djXVXMq4qic8PqEa8+rpvIiiAjpft/St9pVD0jbqNpZMcobVUbUuwn2a+cKQr kltCQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggdduieejledtucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepfffhvfevuffkgggtugfgjgesmhekreertddtjeenucfhrhhomheptehlvhgrrhho ucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgheqne cuggftrfgrthhtvghrnhepudelkeekgfdttdettdekgfduvdeiffelteegjeeihfetheek veeftedtuddvhfeunecuffhomhgrihhnpegvnhhtvghrphhrihhsvggusgdrtghomhenuc evlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhvhhgv rhhrvgesrghlvhhhrdhnohdqihhprdhorhhgpdhnsggprhgtphhtthhopeegpdhmohguvg epshhmthhpohhuthdprhgtphhtthhopegrhhestgihsggvrhhtvggtrdgrthdprhgtphht thhopehmihhhrghilhhnihhkrghlrgihvghusehgmhgrihhlrdgtohhmpdhrtghpthhtoh epphhgshhqlhdqhhgrtghkvghrsheslhhishhtshdrphhoshhtghhrvghsqhhlrdhorhhg pdhrtghpthhtoheprhhosgesgiiiihhllhgrrdhnvght X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 30 Oct 2025 19:17:08 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alvh.no-ip.org; s=schmee; t=1761866225; bh=5FRiPY6OgLvndinqwSKEJz+0ajJsIM0G55OX0+Nb4hc=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=Lz1CZIOj3+MRipZhqdd7V/cozICupS97AKelgIxEbr1U+AFb5OHPLTkAm2RcWVGYN du9kNlJtcb2h/7OeW3E6QZHDd/cbnUcvb1RQ60fQFozdWsKoGAOxwdWFcUIAQYIXdJ gOHJ8Co5CWezRuTiUxMHHtALOyfZLFMZ7sv8TmALXQqcWla/9WBeQiNf9vIJBIg4Lj Z3r+wmdHMG/lRQ5zi9aD+Y8qbgVEwdhcFajXqlOzgrDFvozeDwhR7AJx04VFOfQMtw ubw4peGXf+w+oGA16SbM5tfGAZkpEY8u7M7WE8l3igikELA6JoWVOo0nhZGTA8LID4 NVQ2bMqVw2xFA== Received: by schmee.kurilemu.internal (Postfix, from userid 1000) id BAD4D76; Fri, 31 Oct 2025 01:17:05 +0200 (EET) Date: Fri, 31 Oct 2025 00:17:05 +0100 From: Alvaro Herrera To: Pg Hackers Cc: Antonin Houska , Mihail Nikalayeu , Robert Treat Subject: Re: Adding REPACK [concurrently] Message-ID: <202510301734.pj4uds3mqxx4@alvherre.pgsql> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="ecl2euvoqutt27wj" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <202507262156.sb455angijk6@alvherre.pgsql> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --ecl2euvoqutt27wj Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit Hello, Here's a new installment of this series, v25, including the CONCURRENTLY part, which required some conflict fixes on top of the much-changed v24-0001 patch. After the talk on this subject for PGConf.EU, there were some reservations about this whole project, and if I understand correctly, they can be summarized in these three points: 1. Would the spill files for reorderbuffers occupy as much disk space as it takes to copy the initial contents of the table, for each active logical decoding replication slot? Antonin claims (I haven't verified this) that there are some hacks in place to avoid this problem, or that it is easy to install some -- and if so, then this patch would already be better than pg_repack. This perhaps merits more testing. 2. Is the concurrent REPACK operation MVCC-safe? At the moment, with the present implementation, no it is not. There are discussions on getting this fixed, and Mihail has proposed some patches which at least are quite short, though their safety is something we need to assess in more depth. 3. Would the xmin horizon remain stuck at the spot where REPACK started, thereby preventing VACUUM from cleaning up recently-dead rows in other tables? As I understand, with the current implementation, yes it would, and we cannot easily apply hacks such as PROC_IN_VACUUM to prevent it, because it would introduce the same problems it did for CREATE INDEX CONCURRENTLY that was fixed in pg14 (commit 042b584c7f7d62). Mihail and Antonin have discussed possible ways to ease this, but we don't have code for that yet. This is, again, no worse than VACUUM FULL or CLUSTER, so lack of this wouldn't be a killer for this project, though of course it would be much better to do better. I have not yet addressed Robert Treat's feedback from October 12th. -- Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/ Officer Krupke, what are we to do? Gee, officer Krupke, Krup you! (West Side Story, "Gee, Officer Krupke") --ecl2euvoqutt27wj Content-Type: text/x-diff; charset=utf-8 Content-Disposition: attachment; filename="v25-0001-Add-REPACK-command.patch" Content-Transfer-Encoding: 8bit