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.94.2) (envelope-from ) id 1uYq4g-00CRkD-0i for pgsql-hackers@arkaria.postgresql.org; Mon, 07 Jul 2025 17:56:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1uYq4e-0046rH-4N for pgsql-hackers@arkaria.postgresql.org; Mon, 07 Jul 2025 17:56:16 +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.94.2) (envelope-from ) id 1uYq1X-0043y4-B1 for pgsql-hackers@lists.postgresql.org; Mon, 07 Jul 2025 17:53:03 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1uYq1V-006JEx-1a for pgsql-hackers@lists.postgresql.org; Mon, 07 Jul 2025 17:53:03 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 567Hquid436600; Mon, 7 Jul 2025 13:52:56 -0400 From: Tom Lane To: Dilip Kumar cc: Amit Kapila , Alvaro Herrera , Kyotaro Horiguchi , smithpb2250@gmail.com, bharath.rupireddyforpostgres@gmail.com, pgsql-hackers@lists.postgresql.org Subject: Re: A recent message added to pg_upgade In-reply-to: References: <20231102.115834.1012152975995247837.horikyota.ntt@gmail.com> <202311091039.of6jf7bs3cjd@alvherre.pgsql> <219561.1751826409@sss.pgh.pa.us> Comments: In-reply-to Dilip Kumar message dated "Mon, 07 Jul 2025 11:10:39 +0530" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <436598.1751910776.1@sss.pgh.pa.us> Date: Mon, 07 Jul 2025 13:52:56 -0400 Message-ID: <436599.1751910776@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Dilip Kumar writes: >> IMHO we can just query the 'max_slot_wal_keep_size' after >> start_postmaster() and check what is the final resultant value. So now >> we will only throw an error if the final value is not -1. And we can >> remove the hook from the server all together. Thoughts? > I could come up with an attachment patch. I don't love this patch. It's adding more cycles and more complexity to pg_upgrade, when there is a simpler and more direct solution: re-order the construction of the postmaster command line in start_postmaster() so that our "-c max_slot_wal_keep_size" will override anything the user supplies. There's a bigger picture here, though. The fundamental thing that I find wrong with the current code is that knowledge of and responsibility for this max_slot_wal_keep_size hack is spread across both pg_upgrade and the server. It would be better if it were on just one side. Now, unless we want to change that Assert that 8bfb231b4 put into InvalidatePossiblyObsoleteSlot(), the server side is going to be aware of this decision. So I'm inclined to think that we should silently enforce max_slot_wal_keep_size = -1 in binary-upgrade mode in the server's GUC check hook, and then remove knowledge of it from pg_upgrade altogether. Maybe the same for idle_replication_slot_timeout, which really has got the same issue that we don't want users overriding that choice. regards, tom lane