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 1uZQzl-003Zvv-0g for pgsql-bugs@arkaria.postgresql.org; Wed, 09 Jul 2025 09:21:41 +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 1uZQzi-00EoWC-Re for pgsql-bugs@arkaria.postgresql.org; Wed, 09 Jul 2025 09:21:39 +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 1uZQzi-00EoVt-HJ for pgsql-bugs@lists.postgresql.org; Wed, 09 Jul 2025 09:21:39 +0000 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uZQzg-006cLq-28 for pgsql-bugs@lists.postgresql.org; Wed, 09 Jul 2025 09:21:38 +0000 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-3a54700a463so441906f8f.1 for ; Wed, 09 Jul 2025 02:21:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec.at; s=google; t=1752052895; x=1752657695; darn=lists.postgresql.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=kAS6e5ZvE0y9kn6HxnyatdxkYIh3+JU/yBQfTVv2Tmk=; b=TeW9BI9nrCago61g7LZTmaL6YZq3p/NjREHqwsonEktO0lu5KuBunIHcntOtHQSFrO GFvzTMl+ESH1n/c476HjvFTghNqTK4RfTBBSvKLgcWpvzrvkwwXI31cMX2TptFqnMUVe gUdGL5v0YeVe5MK6KdPs5BAETzJg9S/P4fJQV9ojdqFwAthXHCx6i81hSEYWRg9LJc/C LpnVH+MYwt9LpyM0wjkl4QuJDNfjHhuGtpZv5WxnJY/0bKfBmkwpuilKg/6mQg8F4SMU rdA/5ARaZ0vAsumAVdwrCu931l2gY2Jk4zyeYHC410jfcx+GzGJjXGxSu8wYzgC+Z35p 7PBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752052895; x=1752657695; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=kAS6e5ZvE0y9kn6HxnyatdxkYIh3+JU/yBQfTVv2Tmk=; b=qPjz0V2imvsklHR6yMhLIDgelOhibDl8a5RwlWNKJP2KBjJfcJhUrhir7WOMAudmJH pgKCe/XaZkXuBGeRadZrfLqRWzj1u8/MwggGgeolJimySRzSQ78Cq32Wepz6Gg7ASSmr PN4luY/+YUinpuzFr9+6P+7qOHyBc2mcw/2AUo82D5CINGBJvNm7T3ujl19ZLDbba5OL QQ1/C7IeUO0UvdVseAtcnocXmzByu1V1OWLQH+g9XakO/5loysOSQuHD1FGHEJqYbCHS ZRLIl2SU4n2pjRMBL/+62hR5QLIu/8rBSjgKBHN2q4M+bvxg65MF6V3nY+BBNhmxnOB3 c3iQ== X-Forwarded-Encrypted: i=1; AJvYcCVhuVo25588YP8cTSpnPoL1vRqE53+LvJwRWbvuvrrwiLGQvy2oIvL9saegbuCf13GvAuA30/H6b6uQ@lists.postgresql.org X-Gm-Message-State: AOJu0Ywn5lVzNVsrYBcIi7qvWya7GtYZXRAD1ZXCdC8MSpFeqKNIaqWT Aq9z2Rh6y7mFfKy6gI6hd3UK71Mqmu4YkWPblL6D8XMkpjybetNZUSdSNp+h/i6XKgM= X-Gm-Gg: ASbGncvH6nQj0OwFwZ6H2L+THR4wmtMMV+DMFeba8z+Jg5U1uFslGCUvgQJXxwKo9+j B1hfyPfcGvQetcdulaizgho9bhRBQ9kp9ez0kBVqiB/5CTwQU9brsOsxWMqIktv4a/bGTcSBb2w qEv0Le9YTbmoLRS63ww1vjFF1cGMOSk6+WKkRy/UV5u1XfjELgLjIAcb6TepGnz5mbvsC1Ouh96 ml+DLgHVHZNcI0dJ14sZ7FWVuL1ejUO0z1syQmBWnRQHrNxP7ksAUSFFtUumu3hZQq3zad4y70u aqAvXdmcKi3SdEHyQJHqpWQ1pS1uziQNyE+Gi6dCOjBcLtoVp3q9y1bmcbtmehA= X-Google-Smtp-Source: AGHT+IFrxwGWskziF3LB4u8xy5IdGIN3FdN3zArFLy41vJWdS2vOT0V2RuEPtej/Mas5AFIQuor4Sg== X-Received: by 2002:a05:6000:2f85:b0:3b3:9c46:de96 with SMTP id ffacd0b85a97d-3b5de020564mr5506404f8f.21.1752052895011; Wed, 09 Jul 2025 02:21:35 -0700 (PDT) Received: from laurenz.albe-K4N0CV00F97414D ([213.208.157.76]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-454d50df125sm16037135e9.19.2025.07.09.02.21.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Jul 2025 02:21:34 -0700 (PDT) Message-ID: <2dcea297694d9ab8eafd1db70d385ec0b49e3d27.camel@cybertec.at> Subject: Re: Unexpected behavior when setting "idle_replication_slot_timeout" From: Laurenz Albe To: "Hayato Kuroda (Fujitsu)" , Amit Kapila Cc: Tom Lane , "David G. Johnston" , Fujii Masao , Nisha Moond , Gunnar Morling , "pgsql-bugs@lists.postgresql.org" Date: Wed, 09 Jul 2025 11:21:33 +0200 In-Reply-To: References: <30e91649-06dd-453e-8658-5f4acd03a3bd@oss.nttdata.com> <686577f2379e4b978803e72746dcf0dd7baf3937.camel@cybertec.at> <70b183fb-f66e-40d8-b0de-be8c1052fa93@oss.nttdata.com> <472687.1751731008@sss.pgh.pa.us> <474268.1751731988@sss.pgh.pa.us> <1cea80b2ed4f355ae6a68e36f56a1410b59ea4a8.camel@cybertec.at> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.56.2 (3.56.2-1.fc42) MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, 2025-07-09 at 07:24 +0000, Hayato Kuroda (Fujitsu) wrote: > > > +# Wait a bit for the replication slots to become invalid > > > +$node->safe_psql('postgres', "SELECT pg_sleep(2)"); > > >=20 > > > Is it a good idea to add 2s to 'make check-world' for one particular = test? > >=20 > > That is debatable. I thought that adding two seconds would be worth th= e > > advantage of removing the injection point that only fakes the timeout. > > We'd get better test coverage. > >=20 > > But if the people who run the regression tests dozens of times every da= y > > object to the two seconds, I won't insist on this part of the patch. >=20 > I can understand both concerns. One benefit not to use the injection poin= t is > that any machines can run the test. Currently some BF machines do not ena= ble > the injection point, thus the feature has not been verified on these env. > However, unconditional sleep makes the test longer. >=20 > Based on that, I want to propose the hybrid approach; use injection_point= _attach() > if possible, otherwise wait few seconds. One concern is that the test cod= e may be > bit complex, but below codes was enough on my environment. >=20 > ``` > # Check if the 'injection_points' extension is available, as it may be > # possible that this script is run with installcheck, where the module > # would not be installed by default. > if ($node->check_extension('injection_points')) > { > # Register an injection point on the node to forcibly cause a slot > # invalidation due to idle_timeout > $node->safe_psql('postgres', 'CREATE EXTENSION injection_points;'); >=20 > $node->safe_psql('postgres', > "SELECT injection_points_attach('slot-timeout-inval', 'error');"); > } > else > { > # Otherwise wait a bit for the replication slots to become invalid > $node->safe_psql('postgres', "SELECT pg_sleep(2)"); > } > ``` >=20 > Attached patch implements the idea, which can be applied atop v2. How do = you think? I have no objections. I'll leave the decision to Fujii Masao or whoever wants to commit something in this area. Yours, Laurenz Albe