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 1wA8fZ-0026DD-2e for pgsql-hackers@arkaria.postgresql.org; Tue, 07 Apr 2026 15:48:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wA8fX-001AZT-0H for pgsql-hackers@arkaria.postgresql.org; Tue, 07 Apr 2026 15:48:47 +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.96) (envelope-from ) id 1wA8fV-001AZI-2v for pgsql-hackers@lists.postgresql.org; Tue, 07 Apr 2026 15:48:47 +0000 Received: from fhigh-a6-smtp.messagingengine.com ([103.168.172.157]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wA8fU-000000013ed-1Hhf for pgsql-hackers@lists.postgresql.org; Tue, 07 Apr 2026 15:48:45 +0000 Received: from phl-compute-06.internal (phl-compute-06.internal [10.202.2.46]) by mailfhigh.phl.internal (Postfix) with ESMTP id 7C6CE1400308; Tue, 7 Apr 2026 11:48:43 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-06.internal (MEProxy); Tue, 07 Apr 2026 11:48:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm2; t=1775576923; x=1775663323; bh=CdyPNW3iBi Gn8sJN3TEMGldkfZzOF10IwDgUZ5LFTBo=; b=D9teBq5LokdMroszxs7M+mSTpu hj9SC7IAzoV7kJSj4R/2YG2pMQFJ7bMpjDq5JAFOqio7p5lXikRjaf5K8Icnw9fO QI+QLp7i5WzQhAudXhQ94LldnY2jh3tnSEscjMs/Y89TtLWdcpEEJiysOH8PTQ8H k3PGqL19Y2F9G0yf0g98MeimBJLhvDWHOTxrgW8pgEpHsSK5xIdw9U4OhByhbFWQ wcvGxY1GsknG9fHi0W1C66rshNexLMrZRMOpL+9sH8QkILy0ppo37mwEzejy2aUH ZAeVQuUFqVfZeDQ4bouHLxhbbqQUrbI+OcJY0smIqCss22HWU9wHFA5bFVQw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1775576923; x=1775663323; bh=CdyPNW3iBiGn8sJN3TEMGldkfZzOF10IwDg UZ5LFTBo=; b=LpKvWfkfAqh2WW2LQf9Ic4BpEqwUW9iqz4ym9j1Kn3oqoeXo/vr duVQot+90enVy3LJHczmu45ad4uoZueY1BBM41sUWEFV4erysfgs4yJzu1jvXJCl mvJOMIU+rPS0MUDsB/HSpxmYTA0sjJ1VT9nzTQNS/vd1VsvRxoNMLMMpgOliYp7z eyWfKJ0rzR9hKOlt4sUrBsN2Q2pYkFpRo1ryLF3MsZST6LIYZW3JtpMlsoyFx0cE 5j9K6IWSYIF+8fQu5DaOnyz2RmlwzQegT5uSYjyEBhAEW8FF71EgurwdCKW1cpft IR/7P3U6o4OBAxp4K4yAGExzzZ7f+CheMpQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefhedrtddtgddvuddthecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpeffhffvvefukfhfgggtuggjsehttdfstddttddvnecuhfhrohhmpeetnhgurhgvshcu hfhrvghunhguuceorghnughrvghssegrnhgrrhgriigvlhdruggvqeenucggtffrrghtth gvrhhnpeeffffgledvffegtdevlefgtdeggffhvdekgfegteeiveejkeetudelveejhfeu geenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrnh gurhgvshesrghnrghrrgiivghlrdguvgdpnhgspghrtghpthhtohepkedpmhhouggvpehs mhhtphhouhhtpdhrtghpthhtoheprghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdroh hrghdprhgtphhtthhopegrhhestgihsggvrhhtvggtrdgrthdprhgtphhtthhopegrmhhi thdrkhgrphhilhgrudeisehgmhgrihhlrdgtohhmpdhrtghpthhtohepsghovghkvgifuh hrmhdophhoshhtghhrvghssehgmhgrihhlrdgtohhmpdhrtghpthhtohepmhhihhgrihhl nhhikhgrlhgrhigvuhesghhmrghilhdrtghomhdprhgtphhtthhopehsrhhinhgrthhhvd dufeefsehgmhgrihhlrdgtohhmpdhrtghpthhtohepphhgshhqlhdqhhgrtghkvghrshes lhhishhtshdrphhoshhtghhrvghsqhhlrdhorhhgpdhrtghpthhtoheprhhosgesgiiiih hllhgrrdhnvght X-ME-Proxy: Feedback-ID: id4a34324:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 7 Apr 2026 11:48:42 -0400 (EDT) Date: Tue, 7 Apr 2026 11:48:42 -0400 From: Andres Freund To: Antonin Houska Cc: Alvaro Herrera , Amit Kapila , Mihail Nikalayeu , Srinath Reddy Sadipiralla , Matthias van de Meent , Pg Hackers , Robert Treat Subject: Re: Adding REPACK [concurrently] Message-ID: References: <202604071230.b5axxf3qna3m@alvherre.pgsql> <227677.1775576304@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <227677.1775576304@localhost> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 2026-04-07 17:38:24 +0200, Antonin Houska wrote: > Andres Freund wrote: > > > On 2026-04-07 14:33:50 +0200, Alvaro Herrera wrote: > > > On 2026-Apr-07, Amit Kapila wrote: > > > > > > > I have a question based on 0001's commit message: "This patch adds a > > > > new option to logical replication output plugin, to declare that it > > > > does not use shared catalogs (i.e. catalogs that can be changed by > > > > transactions running in other databases in the cluster).". In which > > > > cases, currently plugin needs to access multi-database transactions or > > > > transactions that need to access shared catalogs and on what basis a > > > > plugin can decide that the changes it requires won't need any such > > > > access. > > > > > > I don't think any plugin needs "multi-database" access as such, but > > > needing access to shared catalogs is likely normal. Repack knows it > > > won't access any shared catalogs, so it can set the flag at ease. > > > > > > There's a cross-check added in the commit that tests for access to > > > shared catalogs if the flag is set to false. I guess you could set it > > > to false and see what breaks :-) > > > > I think this has a quite high chance of indirect breakages. You just need some > > cache invalidation processing / building accessing shared catalogs to violate > > the rule, and whether that happens very heavily depends on what cache entries > > are present and whether something registers relcache callbacks or such. > > > > This can be triggered by an output function during logical decoding or such, > > so you don't really have control over it. > > The REPACK plugin only deforms tuples and writes them to a file, so I think > that things like this should not happen. You don't need to do it yourself. It just requires a shared_preload_library extension to register a relcache invalidation callback that accesses shared catalog. It's only kind of an accident that we don't have a case today that accesses shared catcaches during a relcache build in core (I'm not even sure there's nothing). You'd just need somebody to add e.g. relcache caching for publications for that to change. Or look up information about a reloption in pg_parameter_acl. Or lookup tablespace configuration. > However, I admit that an option that allows the plugin developer to declare > "I don't need shared catalogs" may be considered deceptive. At the very least it would need to be a runtime check rather than just an assert. This would much more likely to be hit in production because otherwise it's probably hard to hit the case where shared invalidations happen in the wrong moment. And the consequences are corrupted caches, which could cause all kinds of havoc. But I think this may need more infrastructure / deeper analysis than what we can do right now. Greetings, Andres Freund