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 1uhWV6-000tAi-DU for pgsql-hackers@arkaria.postgresql.org; Thu, 31 Jul 2025 16:51:29 +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 1uhWU5-002M3k-T1 for pgsql-hackers@arkaria.postgresql.org; Thu, 31 Jul 2025 16:50:25 +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.94.2) (envelope-from ) id 1uhWU4-002M2K-BS for pgsql-hackers@lists.postgresql.org; Thu, 31 Jul 2025 16:50:25 +0000 Received: from fout-a3-smtp.messagingengine.com ([103.168.172.146]) by makus.postgresql.org with smtp (Exim 4.96) (envelope-from ) id 1uhWTw-0002pT-1e for pgsql-hackers@lists.postgresql.org; Thu, 31 Jul 2025 16:50:23 +0000 Received: from phl-compute-01.internal (phl-compute-01.phl.internal [10.202.2.41]) by mailfout.phl.internal (Postfix) with ESMTP id 0752CEC130E; Thu, 31 Jul 2025 12:50:16 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-01.internal (MEProxy); Thu, 31 Jul 2025 12:50:16 -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=1753980615; x=1754067015; bh=O 4a4YJ1A7QSMNOVnf3zBgn2dAOmYeAcoFYbT8j/ilvY=; b=UhfJWJFxuC1zIcg3T OIHJ099dwTYqsEGzdHLn7xNcC0cR76f41pbkIE8Nyvpy1DCDzp/NBtp1JvA3EDiE LBEQftOFBUGgxjpdJVlAVMMovammnoQihP8SG5VjA9szEC8BXv2z0WRvqNPApgI5 /VzbNYBE1CD/qIEm5ce7SvcWSbvRWRi3B811mPVeTMQ1f035DeMQQ6CUVZNuC/Sd zGHfmaL/fRiKtF7TUySZMi84X37u5o4AYd/n/wk7hs+4yc4b4+jY6SImahZsURig 8VyffysIUbR7mU4E2pVE9hjGIRNgLWSzG+3ocPK/6OIV7DnIkUtxAv39zYnPUEV6 W3MUA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdefgddutddufeegucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepfffhvfevuffkgggtugfgjgesmhekreertddtjeenucfhrhhomheptehlvhgrrhho ucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgheqne cuggftrfgrthhtvghrnhepudelkeekgfdttdettdekgfduvdeiffelteegjeeihfetheek veeftedtuddvhfeunecuffhomhgrihhnpegvnhhtvghrphhrihhsvggusgdrtghomhenuc evlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhvhhgv rhhrvgesrghlvhhhrdhnohdqihhprdhorhhgpdhnsggprhgtphhtthhopeegpdhmohguvg epshhmthhpohhuthdprhgtphhtthhopegrhhestgihsggvrhhtvggtrdgrthdprhgtphht thhopehmrghsrghordhfuhhjihhisehgmhgrihhlrdgtohhmpdhrtghpthhtohepphhgsh hqlhdqhhgrtghkvghrsheslhhishhtshdrphhoshhtghhrvghsqhhlrdhorhhgpdhrtghp thhtoheprhhosgesgiiiihhllhgrrdhnvght X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 31 Jul 2025 12:50:13 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alvh.no-ip.org; s=schmee; t=1753980611; bh=Ho+k/yr33BGM+P7BSVG74y3wf4dBRhJX5OLucJrKQq4=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=USO/f7zZbX1yD8epHBI6s/fjD8xI0iroAZXC4Ipak561dcqTcivNb/mwbC4cCjhw+ 3upmm3OXINGaetwAWS2VOfijGilxc05B4KSPkirTezVrIh3cjEDVb8tTcA/a/atgOi jBJg9BRZkMaYRWpW3CD5UfyZVDzvNEnUYp2KBhNSP64K8GQX/xOws7s3uiYDLNVWgP GqMCBN6MxruwF3KmuQZrUhRxmr7w+OPm67W8HesW1E5v7SU+UYMts9iMeChKfYpPVc GEiiBGgJ1JQLj5LIvgAMpUvFgmUyGQzllO6DcZFZWih65wiU+Y3nsbFhl3BnELgUoa vq6WOO+DcHM4Q== Received: by schmee.kurilemu.internal (Postfix, from userid 1000) id 4357090; Thu, 31 Jul 2025 18:50:11 +0200 (CEST) Date: Thu, 31 Jul 2025 18:50:11 +0200 From: Alvaro Herrera To: Robert Treat , Fujii Masao Cc: Pg Hackers , Antonin Houska Subject: Re: Adding REPACK [concurrently] Message-ID: <202507311650.3a44mqyi3xnw@alvherre.pgsql> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="ghyrlegy6t3fabqb" 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 --ghyrlegy6t3fabqb Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit On 2025-Jul-26, Robert Treat wrote: > For clarity, are you intending to commit this patch before having the > other parts ready? (If that sounds like an objection, it isn't) After > a first pass, I think there's some confusing bits in the new docs that > could use straightening out, but there likely going to overlap changes > once concurrently is brought in, so it might make sense to hold off on > those. I'm aiming at getting 0001 committed during the September commitfest, and the CONCURRENTLY flag addition later in the pg19 cycle. But I'd rather have good-enough docs at every step of the way. They don't have to be *perfect* if we want to get everything in pg19, but I'd rather not leave anything openly confusing even transiently. That said, I did not review the docs this time around, so here's them the same as they were in the previous post. But if you want to suggest changes for the docs in 0001, please do. Just don't get too carried away. > speaking of, for this bit in src/backend/commands/cluster.c > > + switch (cmd) > + { > + case REPACK_COMMAND_REPACK: > + return "REPACK"; > + case REPACK_COMMAND_VACUUMFULL: > + return "VACUUM"; > + case REPACK_COMMAND_CLUSTER: > + return "VACUUM"; > + } > + return "???"; > > The last one should return "CLUSTER" no? Absolutely -- my blunder. On 2025-Jul-27, Fujii Masao wrote: > > The patch submitted here, largely by Antonin Houska with some > > changes by me, is based on the the pg_squeeze code which he > > authored, and first introduces a new command called REPACK to absorb > > both VACUUM FULL and CLUSTER, followed by addition of a CONCURRENTLY > > flag to allow some forms of REPACK to operate online using logical > > decoding. > > Does this mean REPACK CONCURRENTLY requires wal_level = logical, while > plain REPACK (without CONCURRENTLY) works with any wal_level setting? > If we eventually deprecate VACUUM FULL and CLUSTER, I think plain > REPACK should still be allowed with wal_level = minimal or replica, so > users with those settings can perform equivalent processing. Absolutely. One of the later patches in the series, which I have not included yet, intends to implement the idea of transiently enabling wal_level=logical for the table being repacked concurrently, so that you can still use the concurrent mode if you have a non-logical-wal_level instance. > + if (!cluster_is_permitted_for_relation(tableOid, userid, > + CLUSTER_COMMAND_CLUSTER)) > > As for the patch you attached, it seems to be an early WIP and > might not be ready for review yet?? BTW, I got the following > compilation failure and probably CLUSTER_COMMAND_CLUSTER > the above should be GetUserId(). This was a silly merge mistake, caused by my squashing Antonin's 0004 (trivial code restructuring) into 0001 at the last minute and failing to "git add" the compile fixes before doing git-format-patch. Here's v17. (I decided that calling my previous one "v1" after Antonin had gone all the way to v15 was stupid on my part.) The important part here is that I rebased Antonin 0004's, that is, the addition of the CONCURRENTLY flag, plus 0005 regression tests. The only interesting change here is that I decided to not mess with the grammar by allowing an unparenthesized CONCURRENTLY keyword; if you want concurrent, you have to say "REPACK (CONCURRENTLY)". This is at odds with the way we use the keyword in other commands, but ISTM we don't _need_ to support that legacy syntax. Anyway, this is easy to put back afterwards, if enough people find it not useless. I've not reviewed 0003 in depth yet, just rebased it. But it works to the point that CI is happy with it. I've not yet included Antonin's 0006 and 0007. TODO list for 0001: - addition of src/bin/scripts/repackdb - clean up the progress report infrastructure - doc review -- Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/ Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest "foo" someone someday shall type "supercalifragilisticexpialidocious" (5th Commandment for C programmers) --ghyrlegy6t3fabqb Content-Type: text/x-diff; charset=utf-8 Content-Disposition: attachment; filename="v17-0001-Add-REPACK-command.patch"