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 1w9Ans-001EoW-25 for pgsql-hackers@arkaria.postgresql.org; Sat, 04 Apr 2026 23:53:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w9Anq-000ttM-0m for pgsql-hackers@arkaria.postgresql.org; Sat, 04 Apr 2026 23:53: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 1w9Anp-000ttE-11 for pgsql-hackers@lists.postgresql.org; Sat, 04 Apr 2026 23:53:22 +0000 Received: from fhigh-a7-smtp.messagingengine.com ([103.168.172.158]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1w9Anj-00000000drT-3lgQ for pgsql-hackers@lists.postgresql.org; Sat, 04 Apr 2026 23:53:21 +0000 Received: from phl-compute-09.internal (phl-compute-09.internal [10.202.2.49]) by mailfhigh.phl.internal (Postfix) with ESMTP id 80CBD140006F; Sat, 4 Apr 2026 19:53:12 -0400 (EDT) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-09.internal (MEProxy); Sat, 04 Apr 2026 19:53: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=1775346792; x=1775433192; bh=h KHKBt4qmGSwBOMQvx4ptbIRK7N/KBpjHp8fBElAou4=; b=pC9xRR8emwDh2V1CK BsV7Fyq9sOfsXTl5+1zyT9Riq89yn5drI43hdifN5knc1qGfLdyztSKHA1HtCxe3 psh0t0CMQZmQabT+zUHFWxecAdYGYyEmEgfjr2xx1D5eF8fs2OAO8V4YJARSoS2K C5UEKB9L5izdVpyATbDEpsSWqZcPey2J3mWt97IIhmbc6yBik4HwItLyqSbuB828 u2z7V1boYbCWaFe8Td6o9ODzBzHaoC3a9jlFgRG66jGXUHx4j5AVJZQZRgqkV0Ma n4y7yEFlDAjKyaE4UDnHwh8L8cuwJP980SGkNbECFc5AyoV8rj9158HuXbu1kmtJ Sj4sg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefhedrtddtgddufedvvdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpeffhffvvefukfggtggugfgjsehmkeerredttdejnecuhfhrohhmpeetlhhvrghrohcu jfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhgqeenuc ggtffrrghtthgvrhhnpeduleekkefgtddttedtkefguddvieffleetgeejiefhteehkeev feettdduvdfhueenucffohhmrghinhepvghnthgvrhhprhhishgvuggsrdgtohhmnecuve hluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghlvhhhvghr rhgvsegrlhhvhhdrnhhoqdhiphdrohhrghdpnhgspghrtghpthhtohepjedpmhhouggvpe hsmhhtphhouhhtpdhrtghpthhtoheprghhsegthigsvghrthgvtgdrrghtpdhrtghpthht oheprghmihhtrdhkrghpihhlrgduieesghhmrghilhdrtghomhdprhgtphhtthhopegsoh gvkhgvfihurhhmodhpohhsthhgrhgvshesghhmrghilhdrtghomhdprhgtphhtthhopehm ihhhrghilhhnihhkrghlrgihvghusehgmhgrihhlrdgtohhmpdhrtghpthhtohepshhrih hnrghthhdvudeffeesghhmrghilhdrtghomhdprhgtphhtthhopehpghhsqhhlqdhhrggt khgvrhhssehlihhsthhsrdhpohhsthhgrhgvshhqlhdrohhrghdprhgtphhtthhopehroh gsseigiihilhhlrgdrnhgvth X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 4 Apr 2026 19:53:11 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alvh.no-ip.org; s=schmee; t=1775346789; bh=4/owXQoFgvljJqWivC1N6s2iTzvXDonmHqPy2AiJylo=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=i4Gs/sTssm6xeTaVibG8JvxayuvDcvJbmj+WS1rKQbrGPmlpEZN1Pwxw4o0Vkor9J oVAFJB7NA14D2CacAHInq/aFUfawUs7uurso05AGrT2FY+Z3qQgKtWxwJOSd06hWV7 eRHbV59AaRjv9Xg7jlK65gU0d4UZD1D1SBRqPi/6/VGwGy3PphT27aqUUc/+J4Zu3N 6PzYn1x3gQgT0Qj89sR75hKKyvK8myLFe22cpWsRMd/efJUsuo037kbEr8YJp7gywI BobxKKbtAS069HSQ/i1IhagsCRAy19xdsfkBrdfdLFw2CHPilP9obelCtRyJwmD1F8 NCdc9awvqHlxw== Received: by schmee.kurilemu.internal (Postfix, from userid 1000) id 566B87C; Sun, 05 Apr 2026 01:53:09 +0200 (CEST) Date: Sun, 5 Apr 2026 01:53: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: <202604042326.nwa4o5sezj77@alvherre.pgsql> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="qr3jlalmmcpkiodg" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <95398.1775316559@localhost> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --qr3jlalmmcpkiodg Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit On 2026-Apr-04, Antonin Houska wrote: > Alvaro Herrera wrote: > > > On 2026-Apr-04, Antonin Houska wrote: > > > > > I agree that the global variable is not handy, but instead of modifying > > > CreateInitDecodingContext(), how about adding a boolean returning callback to > > > OutputPluginCallbacks? The point is that whether shared catalogs are needed > > > during the decoding or not is actually property of the plugin. > > > > Oh, yeah, that sounds good to me. > > This is it. New callback was actually not needed, I just added a new flag to > the OutputPluginOptions structure. Thank you, I removed the previous one and picked up this one (it's 0001 here.) The only potentially troublesome thing I see with it is this change: /* * Update range of interesting xids based on the running xacts * information. We don't increase ->xmax using it, because once we are in * a consistent state we can do that ourselves and much more efficiently * so, because we only need to do it for catalog transactions since we * only ever look at those. * * NB: We only increase xmax when a catalog modifying transaction commits * (see SnapBuildCommitTxn). Because of this, xmax can be lower than * xmin, which looks odd but is correct and actually more efficient, since * we hit fast paths in heapam_visibility.c. + * + * If database specific transaction info was used during startup, the info + * for the whole cluster can make xmin go backwards. That would be bad + * because we might no longer have older XIDs in ->committed. */ - builder->xmin = running->oldestRunningXid; + if (NormalTransactionIdFollows(running->oldestRunningXid, builder->xmin)) + builder->xmin = running->oldestRunningXid; I can't see any problem with advancing the ->xmin only when it goes forward, but I wonder if it's possible to introduce any bugs this way. This bit looks funny though: /* * Advance the xmin limit for the current replication slot, to allow * vacuum to clean up the tuples this slot has been protecting. * * The reorderbuffer might have an xmin among the currently running * snapshots; use it if so. If not, we need only consider the snapshots * we'll produce later, which can't be less than the oldest running xid in * the record we're reading now. */ xmin = ReorderBufferGetOldestXmin(builder->reorder); - if (xmin == InvalidTransactionId) + /* + * Like above, do not let slot xmin go backwards. + */ + if (xmin == InvalidTransactionId && !db_specific) xmin = running->oldestRunningXid; I probably need some sleep, but this doesn't make sense to me. -- Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/ "No me acuerdo, pero no es cierto. No es cierto, y si fuera cierto, no me acuerdo." (Augusto Pinochet a una corte de justicia) --qr3jlalmmcpkiodg Content-Type: text/x-diff; charset=utf-8 Content-Disposition: attachment; filename="v53-0001-Introduce-an-option-to-make-logical-replication-.patch"