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 1w2aXU-000QGX-06 for pgsql-hackers@arkaria.postgresql.org; Tue, 17 Mar 2026 19:57:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w2aXR-004c1a-2F for pgsql-hackers@arkaria.postgresql.org; Tue, 17 Mar 2026 19:57:13 +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 1w2aXR-004c1S-0P for pgsql-hackers@lists.postgresql.org; Tue, 17 Mar 2026 19:57:13 +0000 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w2aXM-00000000f55-2zGw for pgsql-hackers@lists.postgresql.org; Tue, 17 Mar 2026 19:57:12 +0000 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-4852a9c6309so50829175e9.0 for ; Tue, 17 Mar 2026 12:57:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec.at; s=google; t=1773777428; x=1774382228; darn=lists.postgresql.org; h=message-id:date:mime-version:comments:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=d4bEBGWnnYKV0oW5MxjFUQ4wXqMhvPqUB2ynFT0zQa4=; b=gSbWRrdBPtv23v+eeUmrwh1Fvae4lwnuUG4UdqxaOt4cSOjvivrjbNAUqhANjs3mJw 0svQQ0lAGil8bNbvFKAW1gRq/85Rn45qKfZXw/1tDvNdweOqYDNAEm35a4K0QzZHtXsQ elfQO1do3jsdPlA7ZqaPSnJCVQK0Wi881tFNojiCE5djrq8Z3hbRPMxYH39eYEraAcCs xFL3XS6vnVMvQ/T41GwIeOecI5JYy5vredggJ0Zh2+ypqIS7sPVOOaVsbomFEarD+SWh qmp96eCqvzmKgC79nVt5YSHe0L/XNWC/AmZCIMHFPNBba1iylNCE4W4hypbrZ28bs3OR BbHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773777428; x=1774382228; h=message-id:date:mime-version:comments:references:in-reply-to :subject:cc:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=d4bEBGWnnYKV0oW5MxjFUQ4wXqMhvPqUB2ynFT0zQa4=; b=IxyqEyDqdSxFdUG0LE9/yRyNKfysu1BkfEKA2EsFqyzfUpTX1a6Wa634TgRyLf20eu TDhNFf62TLWMe8CVnEkXjUe8T+1keiRlogle2zbaasvDShfMfDoHXrrzkZufxnapAUnq AJKTwr2buMrsCyR0TohoK/1fx5SFBw3Q1HaRLE1uFx22v3vy9tQtusvz6p25GPozt22u wPd90rNFKEpdmwb7H7t91cRdfgWiyoGxP+frHZQv1yELnLDk2n5qo0pqRwFbjlqps6i1 JDpTLOXm/t7qXMGuQmYQW95xDILgck38ZI167RfRnjte1t3RGr5ZMams4ujhaamRWKto 5pog== X-Forwarded-Encrypted: i=1; AJvYcCWlPx8Ww0s1V87foPkCY/17gONFYCFoz1uR7oz+ZBXhWEkojbr03COFrzxioSksOwv4nb4pZrCbIoyHe1sr@lists.postgresql.org X-Gm-Message-State: AOJu0YxhHmDDpIFf9/iSSOd529728erH6a4Gqp1tPkdGqCgZwuRxTua8 U8YSXYPKJ7+B6mdnmnOsNNlXvKCk96evf0t6TZSQYtMGGizTT1CI+qu9DMYdJT/9nF0= X-Gm-Gg: ATEYQzw1yvDJb/zGQSF8oMlZcuQD/peRkam+KuiGrcKJbl6V4xyVnWWvYOdq7oxDg7n 5sQtFm1k94+N9qseQyswc6CqN4Hm2Fd216xksFKWFAZeTVIeZWRkM51YTIF7sXuc2PU3WKLwgZu N8m9/C7R8dqTsr9azn/iGugUHOx4gzfrXLyZ4sg0cpHHE5dUdMVoBh6SSmVACQn3ztgKvU6Fwp+ PtBktHWhFazokd+JnADqy3AwDXacSNrmF621O7LhKHA+48zFO0imIB5JdyjT/V5WZmLGb//2sjC uyFkSTnJrJV65aKVyZruHjBuJ0IliqhQvY/B1/TijK48Ovnnd37VdVKwSFB/ymxff+/rDrdVYA4 tOF9H2LRB2tA7n5lqLX+bRfqOu/0mf71ukCt/UVXEzBXzY/OYnrSmjynwNUCDAursom7mNN67X4 ro1nqQ1cJwK3LCQdlji+vBSM6nKFZ4jxc6pilc X-Received: by 2002:a05:600c:1f11:b0:485:3ae8:2231 with SMTP id 5b1f17b1804b1-486f4460586mr13616375e9.30.1773777427885; Tue, 17 Mar 2026 12:57:07 -0700 (PDT) Received: from localhost (109-81-168-142.rct.o2.cz. [109.81.168.142]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-486f420de8asm11875205e9.3.2026.03.17.12.57.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Mar 2026 12:57:07 -0700 (PDT) From: Antonin Houska To: Alvaro Herrera Cc: Matthias van de Meent , Mihail Nikalayeu , Pg Hackers , Robert Treat Subject: Re: Adding REPACK [concurrently] In-reply-to: <9548.1773744820@localhost> References: <202603162202.l2sibdzviih7@alvherre.pgsql> <9548.1773744820@localhost> Comments: In-reply-to Antonin Houska message dated "Tue, 17 Mar 2026 11:53:40 +0100." X-Mailer: MH-E 8.6+git; nmh 1.8; GNU Emacs 28.3 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Date: Tue, 17 Mar 2026 20:57:06 +0100 Message-ID: <91049.1773777426@localhost> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --=-=-= Content-Type: text/plain Antonin Houska wrote: > Alvaro Herrera wrote: > > > On 2026-Mar-16, Matthias van de Meent wrote: > > > > > On Mon, 16 Mar 2026 at 21:15, Antonin Houska wrote: > > > > > > Anyway (fortunately?), the concurrent use of slots by REPACK is limited > > > > because, during the initialization of logical decoding, the backend needs to > > > > wait for all the transactions having XID assigned to finish, and these include > > > > the already running REPACK commands. See SnapBuildWaitSnapshot() and callers > > > > if you're interested in details. > > > > > > Huh, so would you be able to run more than one Repack Concurrently in > > > the same database? ISTM that would not be possible, apart from > > > possibly a mechanism comparable to the SAFE_IN_IC flag (to not wait on > > > those backends). > > > > Yeah, this sounds kind of bad news ... > > Admittedly, it is a problem. I tried to address this in pg_squeeze by > pre-allocating slots when it's clear (due to scheduling) that more than one > table needs to be processed. This was an effort to achieve the best possible > performance rather than a response to complaints of users about low > throughput. Nevertheless, I'm glad I happened to mention it before it's too > late. > > Regarding solution, a flag like SAFE_IN_IC alone does not help. The > information that particular transaction is used by REPACK (and therefore it > does not have to be decoded) would need to be propagated to the > xl_running_xacts WAL record too. 0007 in the next version tries to implement that. -- Antonin Houska Web: https://www.cybertec-postgresql.com --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=v42-0001-Refactor-index_concurrently_create_copy-for-use-with.patch