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 1w8fzX-000lnb-21 for pgsql-hackers@arkaria.postgresql.org; Fri, 03 Apr 2026 14:59:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w8fzW-00C9aK-08 for pgsql-hackers@arkaria.postgresql.org; Fri, 03 Apr 2026 14:59:22 +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 1w8fzV-00C9aB-0H for pgsql-hackers@lists.postgresql.org; Fri, 03 Apr 2026 14:59:22 +0000 Received: from fout-a7-smtp.messagingengine.com ([103.168.172.150]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1w8fzP-00000000OE7-27Do for pgsql-hackers@lists.postgresql.org; Fri, 03 Apr 2026 14:59:21 +0000 Received: from phl-compute-10.internal (phl-compute-10.internal [10.202.2.50]) by mailfout.phl.internal (Postfix) with ESMTP id D4307EC036B; Fri, 3 Apr 2026 10:59:12 -0400 (EDT) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-10.internal (MEProxy); Fri, 03 Apr 2026 10:59:12 -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=1775228352; x=1775314752; bh=I LR0mchIZfH86GlJvkP9rz3gf7CzJznl0RLnZ3QDWZA=; b=tYw0R56fp0Vr2lOsI E15V/Id9UjdIogKPQpqVMcP5DM44bLtjD4tolrLCA+lCa+m0P+vIQeg5YoFPfhy7 +/D4gzvvxKCKYSuSNyc00TeoTjnvGYD89cr2v576v3dC/cs34NlBeAAh1PscDirX Eecc7h/hTufcYw8zi6fYttQmxV+x63bGgarGEUSxqIPR0GIyGLtnC6x0t5KbzHJL 0UQ24GDa91KuTgseJEV2LcT7/VnOoMvS10vPwunmFpqAUz3Nx/VyJHtzF3WMn2Dv amLS5wqGT2Fqp6HcmL/SIWgvmb12LWSYocZHIBNt/Um1knqNhVmfS5zOo2W9cUSw OQTgQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefhedrtddtgdelvdegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceurghi lhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurh epfffhvfevuffkgggtugfgjgesmhekreertddtjeenucfhrhhomheptehlvhgrrhhoucfj vghrrhgvrhgruceorghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgheqnecugg ftrfgrthhtvghrnhepgeelgeeiveduffdtgfehtddvudffgeetieeihfegtdeugfdtvedt heejueeftdevnecuffhomhgrihhnpegvnhhtvghrphhrihhsvggusgdrtghomhdpphhosh htghhrrdgvshenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhr ohhmpegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhgpdhnsggprhgtphhtth hopeejpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopegrhhestgihsggvrhhtvggt rdgrthdprhgtphhtthhopegrmhhithdrkhgrphhilhgrudeisehgmhgrihhlrdgtohhmpd hrtghpthhtohepsghovghkvgifuhhrmhdophhoshhtghhrvghssehgmhgrihhlrdgtohhm pdhrtghpthhtohepmhhihhgrihhlnhhikhgrlhgrhigvuhesghhmrghilhdrtghomhdprh gtphhtthhopehsrhhinhgrthhhvddufeefsehgmhgrihhlrdgtohhmpdhrtghpthhtohep phhgshhqlhdqhhgrtghkvghrsheslhhishhtshdrphhoshhtghhrvghsqhhlrdhorhhgpd hrtghpthhtoheprhhosgesgiiiihhllhgrrdhnvght X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 3 Apr 2026 10:59:11 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alvh.no-ip.org; s=schmee; t=1775228349; bh=CwCzRO0NTZz6yXdgUZIgT7P6pE85p74+pqiuEJcg48M=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=eVSHGYhmBaad/ST1lakjVzyAsDv9fIwDfWlJdADiGpQhm5ebO5udnVJwR0x3WWRGY RDK8IjemKaOG3kscpladShdJgolEY69j9xXckK5q8TpqL8Bv5Z1LVVVEmvwj56ctLI Eh0o5xqAW0hXMmZcirHcp5/3SYGdAvfL4QBeWfTH6r7mzZic1w5L051FVaOmhTUp0f 2qKTtLvNvQ0cUxc3FnhHBWFeWYcoY6rhWZsCAQh8iePNWjmt8tg0l8SDC45UGjoP4a QDrULJcDP+GHtxnzRudABguI0sbDpcy/8MuXxJg0b5bWWhP45w2fyFWKCSJtGDzBxA iWQh//xbNQ1gw== Received: by schmee.kurilemu.internal (Postfix, from userid 1000) id 82C067C; Fri, 03 Apr 2026 16:59:09 +0200 (CEST) Date: Fri, 3 Apr 2026 16:59:09 +0200 From: Alvaro Herrera To: Antonin Houska Cc: Srinath Reddy Sadipiralla , Amit Kapila , Mihail Nikalayeu , Matthias van de Meent , Pg Hackers , Robert Treat Subject: Re: Adding REPACK [concurrently] Message-ID: <202604031448.3nakw63kxkmr@alvherre.pgsql> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="brnevsqjnuzpyok4" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <90475.1775218118@localhost> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --brnevsqjnuzpyok4 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit On 2026-Apr-03, Antonin Houska wrote: > This is an alternative implementation of 0006, allowing one backend running > REPACK (CONCURRENTLY) in a database, instead of one backend in a cluster. Thanks! so I'm removing the previous one and taking this one. Here's a v50: - In testing, I noticed that we could sometimes request a Flush for a WAL position that hasn't been written yet. This is due to my replacing the original code that wrote a dummy xlog record that we could flush, with a call to XLogGetInsertRecPtr(). So we'd get an error like LOG: request to flush past end of generated WAL; request 0/15CF0018, current position 0/15CF000 Antonin promptly noticed that this is because XLogGetInsertRecPtr() gets the LSN past the segment header, which is 18 bytes wrong. So the fix here is to use XLogGetInsertEndRecPtr() instead. - My testing also uncovered a problem with exclusion constraints; tables with them would fail to repack like ERROR: exclusion constraint record missing for rel temporal_fk_mltrng2mltrng_pk_repacknew Antonin sent a patch to create copies of the constraints on the transient index, which seems like it fixes the problem. Those constraints are obviously discarded together with the transient index. - I polished the patch to reserve replication slots for REPACK. Given the new implementation of 0006 that was submitted implies that we can now run multiple repacks concurrently, I changed the default of 1 to 5. -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/ "Here's a general engineering tip: if the non-fun part is too complex for you to figure out, that might indicate the fun part is too ambitious." (John Naylor) https://postgr.es/m/CAFBsxsG4OWHBbSDM%3DsSeXrQGOtkPiOEOuME4yD7Ce41NtaAD9g%40mail.gmail.com --brnevsqjnuzpyok4 Content-Type: text/x-diff; charset=utf-8 Content-Disposition: attachment; filename="v50-0001-Make-index_concurrently_create_copy-more-general.patch"