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 1uY47m-000fx1-0J for pgsql-bugs@arkaria.postgresql.org; Sat, 05 Jul 2025 14:44: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 1uY47k-006UtW-0w for pgsql-bugs@arkaria.postgresql.org; Sat, 05 Jul 2025 14:44: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 1uY47j-006UtN-OY for pgsql-bugs@lists.postgresql.org; Sat, 05 Jul 2025 14:44:16 +0000 Received: from oss.nttdata.com ([49.212.34.109]) by magus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1uY47h-005u9b-1S for pgsql-bugs@lists.postgresql.org; Sat, 05 Jul 2025 14:44:16 +0000 Received: from [192.168.11.9] (p1696134-ipoe.ipoe.ocn.ne.jp [118.0.93.133]) by oss.nttdata.com (Postfix) with ESMTPSA id CB88C6147D; Sat, 5 Jul 2025 23:44:05 +0900 (JST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at oss.nttdata.com Message-ID: <70b183fb-f66e-40d8-b0de-be8c1052fa93@oss.nttdata.com> Date: Sat, 5 Jul 2025 23:44:05 +0900 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Unexpected behavior when setting "idle_replication_slot_timeout" To: Amit Kapila Cc: Laurenz Albe , Nisha Moond , Gunnar Morling , pgsql-bugs@lists.postgresql.org References: <30e91649-06dd-453e-8658-5f4acd03a3bd@oss.nttdata.com> <686577f2379e4b978803e72746dcf0dd7baf3937.camel@cybertec.at> Content-Language: en-US From: Fujii Masao In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2025/07/05 13:06, Amit Kapila wrote: > On Fri, Jul 4, 2025 at 9:54 PM Fujii Masao wrote: >> >> On 2025/07/05 1:07, Laurenz Albe wrote: >>> On Sat, 2025-07-05 at 00:22 +0900, Fujii Masao wrote: >>>> On 2025/07/04 23:12, Fujii Masao wrote: >>>>> But I wonder why the current unit of this GUC is minutes (GUC_UNIT_MIN). >>>>> Since at least two users (including myself) tried to set it to a value >>>>> less than 1 minute, it might worth considering changing the unit to seconds >>>>> (GUC_UNIT_S). Also which would reduces the chance of the reported trouble. >>>> >>>> Attached patch changes unit of idle_replication_slot_timeout to seconds. >>> >>> -1 >>> >>> I think that the reason that several users tried to set it it less than a minute >>> is that they were trying to test the feature and didn't want to wait long. >>> I cannot imagine that anybody will want to abandon a standby server just >>> because it is idle for more than 30 seconds. >> >> Maybe. But changing the unit to seconds doesn't make things worse, does it? >> It still allows users to set values greater than 1 minute, and also less than >> 1 minute for debugging or testing purposes, if needed. >> > > We expect the value of this variable to be in hours or, in some cases, > days. Specifying in seconds would be inconvenient for users. Now, I > agree there is a value in testing/debugging to allow it to be seconds, > but the same could be said for other variables whose units are in > minutes, like log_rotation_age and wal_summary_keep_time. Even if we change the unit to seconds (GUC_UNIT_S), it's still possible to set the timeout values such as hours or days. For example, even with the patch, we can set the timeout to 365 days: =# ALTER SYSTEM SET idle_replication_slot_timeout TO '365d'; =# SELECT pg_reload_conf(); =# SHOW idle_replication_slot_timeout ; idle_replication_slot_timeout ------------------------------- 365d (1 row) Do you see any serious downside to switching the unit to seconds? I don't think it introduces any serious issues. On the contrary, it gives users finer control over the timeout, and additionally works around the issue that we're discussing here. Regards, -- Fujii Masao NTT DATA Japan Corporation