Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pK7S6-00063P-Cw for pgsql-hackers@arkaria.postgresql.org; Tue, 24 Jan 2023 00:46:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pK7S5-0001a7-9S for pgsql-hackers@arkaria.postgresql.org; Tue, 24 Jan 2023 00:46:17 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pK7S5-0001Zy-0M for pgsql-hackers@lists.postgresql.org; Tue, 24 Jan 2023 00:46:17 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pK7S2-0007KJ-UX for pgsql-hackers@postgresql.org; Tue, 24 Jan 2023 00:46:16 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id E566C5C01B1; Mon, 23 Jan 2023 19:46:13 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Mon, 23 Jan 2023 19:46:13 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= cc:cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm3; t=1674521173; x=1674607573; bh=V1lqvyXXWG 1aq7eFj1a2XH0EBsX6ZRp5/wUxlUKO7mw=; b=wUdIeB3EoBvIYF2ACiiV0JfBI+ jFtQaNYW4d6Gla6+bkJSUixiN+TyQq+RMrDMdu8dckoxsG5kTV64CSwLxBTR3UbU rGlUjWRw5VTLbIFKDpCjk2ptME5bL799MgWx0FJwTvC9QasB/h62zihfLF94xsm9 aFioXMCSd0FxTcrwUvSu4m2eAxQl3aWeQI1MYBl60cXRSUWl7IavJmdxVVY2eICj EMb/1ztROXDgQqdlBIoMoVSBBvmbbiJoxxkBggOnOlS31e/gC6dm8LSYHhb0r8sJ Vbq7iYkuYVhZTi2o/sXmqaHJilFujIcA2rLwvlfzIRmMmbUjP0BY7/EUqdJQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; t=1674521173; x=1674607573; bh=V1lqvyXXWG1aq7eFj1a2XH0EBsX6 ZRp5/wUxlUKO7mw=; b=G05g8Wdt2UfORw7KaLivTHqUqlcr4iH80lfzBu3ut0Nz EMQc0NpaVOTNAa3ntBUlAnTUmR4ICx5CPgNVB3RClzGF9pIarxYX1P8hhVtJh7Y5 k9kNB4q4nvozow/uUt+1EARP4s9Bui83oBRYyoXdgCMvp5xY/u3rfwMvfYNkjFAf H/ezoAW/zntJfAUN+xDOs84HPHxQvjtjnRqjUFVwuGifknhBUfsy9VeyWE6Wk9/8 Sfr3o9p1LyG3trJPfajxjXUOTghu4VisKD0gIgb2c8B4NpD46gWLhk+tyo+Gc5Ln sveKg7Gy+FuYsQIXM6VgpnZQtV60Jy6cThC0EJ8aNw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrudduledgvdeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggujgesthdtredttddtvdenucfhrhhomheptehnughr vghsucfhrhgvuhhnugcuoegrnhgurhgvshesrghnrghrrgiivghlrdguvgeqnecuggftrf grthhtvghrnhepvdfffeevhfetveffgeeiteefhfdtvdffjeevhfeuteegleduheetvedu ieettddunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh eprghnughrvghssegrnhgrrhgriigvlhdruggv X-ME-Proxy: Feedback-ID: id4a34324:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 23 Jan 2023 19:46:13 -0500 (EST) Date: Mon, 23 Jan 2023 16:46:12 -0800 From: Andres Freund To: "Drouvot, Bertrand" Cc: Robert Haas , Thomas Munro , Alvaro Herrera , Ibrar Ahmed , Amit Khandekar , fabriziomello@gmail.com, tushar , Rahila Syed , pgsql-hackers Subject: Re: Minimal logical decoding on standbys Message-ID: <20230124004612.xmryok6tcyk6i4pc@awork3.anarazel.de> References: <1f2ad9fd-53ff-74cc-a602-72d45423bcab@gmail.com> <05c0c4f3-82eb-bc6d-c876-5a265c05927b@gmail.com> <20230106034036.2m4qnn7ep7b5ipet@awork3.anarazel.de> <490206c5-bcde-e558-628a-dc67dae4d439@gmail.com> <20230119024617.jzsgpcrgjdc6ysge@awork3.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 2023-01-19 10:43:27 +0100, Drouvot, Bertrand wrote: > > > With a reload in place in my testing, now I notice that the catalog_xmin > > > is updated on the primary physical slot after logical slots invalidation > > > when reloading hot_standby_feedback from "off" to "on". > > > > > > This is not the case after a re-start (aka catalog_xmin is NULL). > > > > > > I think a re-start and reload should produce identical behavior on > > > the primary physical slot. If so, I'm tempted to think that the catalog_xmin > > > should be updated in case of a re-start too (even if all the logical slots are invalidated) > > > because the slots are not dropped yet. What do you think? > > > > I can't quite follow the steps leading up to the difference. Could you list > > them in a bit more detail? > > > > > > Sure, so with: > > 1) hot_standby_feedback set to off on the standby > 2) create 2 logical replication slots on the standby and activate one > 3) Invalidate the logical slots on the standby with VACUUM FULL on the primary > 4) change hot_standby_feedback to on on the standby > > If: > > 5) pg_reload_conf() on the standby, then on the primary we get a catalog_xmin > for the physical slot that the standby is attached to: > > postgres=# select slot_type,xmin,catalog_xmin from pg_replication_slots ; > slot_type | xmin | catalog_xmin > -----------+------+-------------- > physical | 822 | 748 > (1 row) How long did you wait for this to change? I don't think there's anything right now that'd force a new hot-standby-feedback message to be sent to the primary, after slots got invalidated. I suspect that if you terminated the walsender connection on the primary, you'd not see it anymore either? If that isn't it, something is broken in InvalidateObsolete... > No, but a question still remains to me: > > Given the fact that the row removal case is already done > in the next test (aka Scenario 2), If we want to replace the "vacuum full" test > on the database (done in Scenario 1) with a cheaper one at the table level, > what could it be to guarantee an invalidation? > > Same as scenario 2 but with "vacuum full pg_class" would not really add value > to the tests, right? A database wide VACUUM FULL is also just a row removal test, no? I think it makes sense to test that both VACUUM and VACUUM FULL both trigger conflicts, because they internally use *very* different mechanisms. It'd probably be good to test at least conflicts triggered due to row removal via on-access pruning as well. And perhaps also for btree killtuples. I think those are the common cases for catalog tables. Greetings, Andres Freund