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 1rRoD8-009Tmk-8Q for pgsql-hackers@arkaria.postgresql.org; Mon, 22 Jan 2024 06:55:10 +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 1rRoD7-001sl1-0x for pgsql-hackers@arkaria.postgresql.org; Mon, 22 Jan 2024 06:55:09 +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 1rRoD6-001skt-M3 for pgsql-hackers@lists.postgresql.org; Mon, 22 Jan 2024 06:55:08 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rRoD3-00351n-TA for pgsql-hackers@lists.postgresql.org; Mon, 22 Jan 2024 06:55:08 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id F12915C008E; Mon, 22 Jan 2024 01:55:03 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Mon, 22 Jan 2024 01:55:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; 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=fm3; t=1705906503; x=1705992903; bh=0jP+DM2cJs woyq5soImR3yPJF4anJeUwIGOiu8peEL0=; b=jzPt2TSWlKvZnBk6ITN8hjkD/S dIkFYIe9s3e/WZZ8tW2sBFL/HSeVHjHYbosVFDgXaqzPcyzDjDFjBLm60McwCAYj fB2oBTXbX/sx/DLevqjyMjfpStLVt0DorxMWGdkNLidxVqsklClfpnhHQ8bLBiSI GR5SKkktozLCm5d/6muddLzA/3ta2wTpwCfFlo0vRQhPYobpeLhZzeBw4J4HUnNO oqQRoajHGXgDKxkv60d1T7Jya6NX+o+SlH8+rVP0eT2JcU2s/Ea/oeV9/lAVgLv4 gv+5KD3kI4cmHRzhavDA5CefoemKQTrasKlzpgIZCbHFEOSvbT4EbDJLTLIQ== 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-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; t=1705906503; x=1705992903; bh=0jP+DM2cJswoyq5soImR3yPJF4an JeUwIGOiu8peEL0=; b=WLQRnvXVXXVu+HOXZJ6uux+Y/+Cc1J+psWXGpvQmzFiR 9p/iaSy1Ovy+WC3b86w7soVcKEpmsxgAfYlmXOWkLfY3n4t+mHHG/oIe/dsfbLDg n6+XM5ODSl39O/IuXMydecHH6HXQRrz+3zyaoU3kB+p/nLPeB+OEMmlr597uZnGK XK1oxNCl9rHIF6zcNuU1ueDdUSNSP6jf33j6KsL/NAyc1w3mRUdhXY/Mrd0rY5DH 9fYGzRa6zyxa4XalJDs5153HQtGKc1NBAilMQ6AnwTtxEiJLmlPOoRJLG7Q7gH9f uRwJvbu/auEtlC0LcDfNepfPM549PU8qo7VhvtJQHA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvdekhedgleelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdlfeehmdenucfjughrpeffhffvvefukfhfgggtuggjsehgtderredt tddunecuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesph grqhhuihgvrhdrgiihiieqnecuggftrfgrthhtvghrnhepgffhleefvdehgfeigeehudet tdejuefgledtheeftdefteellefgjeeghefggffgnecuffhomhgrihhnpehpohhsthhgrh gvshhqlhdrohhrghenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhl fhhrohhmpehmihgthhgrvghlsehprghquhhivghrrdighiii X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 22 Jan 2024 01:55:01 -0500 (EST) Date: Mon, 22 Jan 2024 15:54:44 +0900 From: Michael Paquier To: Bertrand Drouvot Cc: Alexander Lakhin , "Yu Shi (Fujitsu)" , Tom Lane , Robert Haas , Andres Freund , Thomas Munro , PostgreSQL Hackers Subject: Re: Test slots invalidations in 035_standby_logical_decoding.pl only if dead rows are removed Message-ID: References: <6f85667e-5754-5d35-dbf1-c83fe08c1e48@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="4TKXCctTLJrFnFGb" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --4TKXCctTLJrFnFGb Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jan 19, 2024 at 09:03:01AM +0000, Bertrand Drouvot wrote: > On Fri, Jan 19, 2024 at 09:00:01AM +0300, Alexander Lakhin wrote: >> 15.01.2024 12:00, Alexander Lakhin wrote: >>> If this approach looks promising to you, maybe we could add a submodule= to >>> perl/PostgreSQL/Test/ and use this functionality in other tests (e.g., = in >>> 019_replslot_limit) as well. >>>=20 >>> Personally I think that having such a functionality for using in tests >>> might be useful not only to avoid some "problematic" behaviour but also= to >>> test the opposite cases. >>=20 >> After spending a few days on it, I've discovered two more issues: >> https://www.postgresql.org/message-id/16d6d9cc-f97d-0b34-be65-425183ed37= 21%40gmail.com >> https://www.postgresql.org/message-id/b0102688-6d6c-c86a-db79-e0e91d245b= 1a%40gmail.com >>=20 >> (The latter is not related to bgwriter directly, but it was discovered >> thanks to the RUNNING_XACTS record flew in WAL in a lucky moment.) >>=20 >> So it becomes clear that the 035 test is not the only one, which might >> suffer from bgwriter's activity, >=20 > Yeah... thanks for sharing! >=20 >> and inventing a way to stop bgwriter/ >> control it is a different subject, getting out of scope of the current >> issue. >=20 > Agree. >=20 >> 15.01.2024 11:49, Bertrand Drouvot wrote: >> Maybe it would be a right move to commit the fix, and then think about >> more rare failures. >=20 > +1 Yeah, agreed to make things more stable before making them fancier. >> 2) Shall we align the 035_standby_logical_decoding with >> 031_recovery_conflict in regard to improving stability of vacuum? >=20 > Yeah, I think that could make sense. Probably. That can always be done as a separate change, after a few runs of the slow buildfarm members able to reproduce the failure. >> I see the following options for this: >> a) use wait_until_vacuum_can_remove() and autovacuum =3D off in both tes= ts; >> b) use FREEZE and autovacuum =3D off in both tests; >> c) use wait_until_vacuum_can_remove() in 035, FREEZE in 031, and >> =A0autovacuum =3D off in both. >=20 > I'd vote for a) as I've the feeling it's "easier" to understand (and I'm = not > sure using FREEZE would give full "stabilization predictability", at leas= t for > 035_standby_logical_decoding.pl). That said I did not test what the outco= me would > be for 031_recovery_conflict.pl by making use of a). Yeah, I think I agree here with a), as v7 does for 035. +# Launch $sql and wait for a new snapshot that has a newer horizon before +# doing the vacuum with $vac_option on $to_vac. +sub wait_until_vacuum_can_remove This had better document what the arguments of this routine are, because that's really unclear. $to_vac is the relation that will be vacuumed, for one. Also, wouldn't it be better to document in the test why txid_current_snapshot() is chosen? Contrary to txid_current(), it does not generate a Transaction/COMMIT to make the test more predictible, something you have mentioned upthread, and implied in the test. - INSERT INTO flush_wal DEFAULT VALUES; -- see create table flush_wal This removes two INSERTs on flush_wal and refactors the code to do the INSERT in wait_until_vacuum_can_remove(), using a SQL comment to document a reference about the reason why an INSERT is used. Couldn't you just use a normal comment here? >> I've re-tested the v6 patch today and confirmed that it makes the test >> more stable. I ran (with bgwriter_delay =3D 10000 in temp.config) 20 tes= ts in >> parallel and got failures ('inactiveslot slot invalidation is logged with >> vacuum on pg_authid') on iterations 2, 6, 6 with no patch applied. >> (With unlimited CPU, when average test duration is around 70 seconds.) >>=20 >> But with v6 applied, 60 iterations succeeded. >=20 > Nice! Thanks for the testing! I need to review what you have more thoroughly, but is it OK to assume that both of you are happy with the latest version of the patch in terms of stability gained? That's still not the full picture, still a good step towards that. -- Michael --4TKXCctTLJrFnFGb Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmWuETQACgkQnvQgOdby QH3dDhAAllml9yfdNmFrjyjkCig1MsShD3Dp1DxDIjb4+sefPAiaPFo+TyaLzki6 UlZm5K1j/Hhq5jx3UPYs9weCuSWkIXBgnDWH0WDmUqYKrqrRvezYhGCAISIyjoEA lixuspwP+qJFsuFRWKXvLhu1Fkfs4ZsQjkMdeF0mNFBq9DRlPS3hDSMV5uSkeF1Y En9mInsZSgufdzxvWkuksln1DrXbq2jvDcw+mAF6WyyUP+PEeBXTN1f+5ygJdhEM kYnXFR+zopWnV9sLOpG5NU1kXvWKcaEILzCD8ATwKYXeGmg3tN1PjqElgeCwNXQk 6gRDIElLSkNld45IM4nTnM1EPw4XUCQ9T2ykDuuyZa4lc9UJOkI9fQUi/YbXY+xK AbtTyzrdAhaFcYX72PcEa9sZ09VjOvDAORgoVhosiHdQeiS6hSX/YM5NfiBb7zhY HNtjcgDYwxzT9t87Kp8U6TFUluE298qIpskZPY+4WmiOKTtUHTJV504Cc17BaWC2 mcq+WlldFWXGTlm8Tvl7fSjXmWWGDb0w16bZQQcHCOr2sXgiFMUERVr/lqQD9Ng9 pkpofcika7q6jpKmx5Njz+s8NE0tYyLTWkbGA0CFtH4OvP0EVEorpf9IOieRBUxg Q3B11xUYykTGXopwL2e8jxfzNeObRQL2T1wpYd3jQqLxMai3/Lo= =OA2f -----END PGP SIGNATURE----- --4TKXCctTLJrFnFGb--