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 1nfwM8-0001UQ-OK for pgsql-hackers@arkaria.postgresql.org; Sun, 17 Apr 2022 04:17:49 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nfwM6-0000l9-Ok for pgsql-hackers@arkaria.postgresql.org; Sun, 17 Apr 2022 04:17:46 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nfwM5-0000gF-2I for pgsql-hackers@lists.postgresql.org; Sun, 17 Apr 2022 04:17:46 +0000 Received: from wout4-smtp.messagingengine.com ([64.147.123.20]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nfwM1-0006iS-Qj for pgsql-hackers@lists.postgresql.org; Sun, 17 Apr 2022 04:17:43 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 3FFA93200E5D; Sun, 17 Apr 2022 00:17:39 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Sun, 17 Apr 2022 00:17:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; 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=fm1; t=1650169058; x=1650255458; bh=WgY26SWHk1 YajuJJwKXalnl0dKvzNDa1AU7sM2d75Ic=; b=U9Ra4tUqsPulnMne8504OoeT7N u0cdCOSEq38B9Dfq/2q+tvdL4UyxQ3V+mFfgLifx0XwOp3HaIFtp4H5CdTRYRvTk iFeTXsNDckvSajxFJSyR47iNwl3ETs5tNEopwyphJQvLCnHi/8DF1nCLHLXk9AzL e4wR3p93Ei27lWId7ICbSmC9wPJRgsTsuPNlqwxNnHFIwAKP4RkNxPD9glnAEVZJ BWn6ZKSjKTxI8MR8s+xBCXluwk0fx3IQBIjgTQIvKkLTJHlZaXXVXIdzLT7cOCPy b0KIDmDv49nMu3cqrwFLXZ829liiHk9IsdJAPSaxdXl+cGIE6PXVLLhRxg6Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; 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:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1650169058; x= 1650255458; bh=WgY26SWHk1YajuJJwKXalnl0dKvzNDa1AU7sM2d75Ic=; b=t DWn22FmrfInAit93DHNzw2L1F2kVE/lVyc/y8zObhRwLYDm04ZoA7u0LbUGz23TH JrGYvGRyyNmEyaYU0U9XCLDlyVBFVs+HhHMV0xSIp6WEhPY54BmeWukW/KlvYLxP 1USimUcu/nVVboKKV/6uet17YzR/SA/jntSJfKibqkhZ4uqymMZiUXqCvgDUTf/M brcfroNJtRP5zyxVnv9hfa36mWydFXJhtKXEiwr7FEr4V+voEDs3p6oiCo0Uo6uT 0pHRqfBA4KKBLPXnMIqxOVe80O4JEim487tMIJUUkKwoVUuiF3OKxogajZMmyWWw jWNR35Gfn0OraeF2PvkJA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrudelkedgkeefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdljedtmdenucfjughrpeffhffvuffkfhggtggujgesghdtreertddt vdenucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprg hquhhivghrrdighiiiqeenucggtffrrghtthgvrhhnpedvgeduuefhtdeuleettdevjeeh heeiveeuieegleetgeeljeelieeuieehgeevhfenucevlhhushhtvghrufhiiigvpedtne curfgrrhgrmhepmhgrihhlfhhrohhmpehmihgthhgrvghlsehprghquhhivghrrdighiii X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 17 Apr 2022 00:17:36 -0400 (EDT) Date: Sun, 17 Apr 2022 13:17:32 +0900 From: Michael Paquier To: Thomas Munro Cc: Andres Freund , Tom Lane , PostgreSQL Hackers Subject: Re: pgsql: Add TAP test for archive_cleanup_command and recovery_end_comman Message-ID: References: <3385143.1649353230@sss.pgh.pa.us> <20220407175210.q44nnrvkovprxo2a@alap3.anarazel.de> <3386734.1649354265@sss.pgh.pa.us> <20220407181202.7xa573u6e2z5dbdz@alap3.anarazel.de> <4015413.1649454951@sss.pgh.pa.us> <20220409005910.alw46xqmmgny2sgr@alap3.anarazel.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="qiufC9HJvalZPqFC" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --qiufC9HJvalZPqFC Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Apr 17, 2022 at 08:56:33AM +1200, Thomas Munro wrote: > Under valgrind I got "Undefined subroutine &main::usleep called at > t/002_archiving.pl line 103" so I added "use Time::HiRes qw(usleep);", > and now I get past the first 4 tests with your patch, but then > promotion times out, not sure why: >=20 > +++ tap check in src/test/recovery +++ > t/002_archiving.pl .. > ok 1 - check content from archives > ok 2 - archive_cleanup_command executed on checkpoint > ok 3 - recovery_end_command not executed yet > # found 00000002.history after 14 attempts > ok 4 - recovery_end_command executed after promotion > Bailout called. Further testing stopped: command "pg_ctl -D > /home/tmunro/projects/postgresql/src/test/recovery/tmp_check/t_002_archiv= ing_standby2_data/pgdata > -l /home/tmunro/projects/postgresql/src/test/recovery/tmp_check/log/002_a= rchiving_standby2.log > promote" exited with value 1 Hmm. As far as I can see, aren't you just hitting the 60s timeout of=20 pg_ctl here due to the slowness of valgrind? > Since it's quite painful to run TAP tests under valgrind, I found a > place to stick a plain old sleep to repro these problems: Actually, I am wondering how you are patching Cluster.pm to do that. > Soon I'll push the fix to the slowness that xlogprefetcher.c > accidentally introduced to continuous archive recovery, ie the problem > of calling a failing restore_command repeatedly as we approach the end > of a WAL segment instead of just once every 5 seconds after we run out > of data, and after that you'll probably need to revert that fix > locally to repro this. Okay. Thanks. Anyway, I'll do something about that tomorrow (no room to look at the buildfarm today), and I was thinking about replacing the while loop I had in the last version of the patch with a poll_query_until that does a pg_stat_file() with an absolute path to the history file to avoid the dependency to usleep() in the test, splitting the fix into two commits as there is more than one problem, each applying to different branches. -- Michael --qiufC9HJvalZPqFC Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmJblNwACgkQnvQgOdby QH2V4Q/+Lio8T/wa6W8pc3cNU6NBmcbU1ClR2zC7DuUNn0uGjf38rWYmwCdyX5bx 3slbJg5XSBjoBD8eH1XaKElgqx7DgRw0YlhO+klKIePkUwABE9+rI58h/kTnL/1M oCTTBPnezpufwH5RNXJ/z+jodII2ZCQAUBM8gv+z3Uq1pEz61nJkORxfZoelaKnP zr9kVEYLKoOzc6Xd5JajEqqH9VyxOpXaojM3u5j23YU2EO+D8+wcCInZd3H0jeFD xS+5dhaB8NG7tdcqQU6NXFkrvef90RmRTzDmbQuMfEph8/LuXll0Ge3HiOef7Qor 710wxC6w49AG9xjwbhy4RBOWi5we608RLMhvPQn8SL0dQHiivyokLY14zFImCFgW DpMH9Pvuw7AaUNtchd2vYnCY/U1o+v4ksrvLN14anyJ+jkEOpbfCpGvf8aJ9IVdw M7pQOXoHjGGe0opHaYuSqgOb2d41y3zFsj2LzYFN3FnSeQM4Sj8E9VyVsXFIIN1W FBGwT7wX1u+L+BPB07ja16Dn5rLrrZUhjr5GYxizlo8KmL+gekqH5Y1BEJ82et1E Uip6DrOhaLqJUz1b+P2cOGhtFF23rSKcEm9yB9OL3HnmhrgwCe6bNYH2KuUuSmpI y2LCZbLfd561X5Uf6j7zaSMq9IB6jNzcSD9AVc1Pb+OaSM8KHI8= =l1BX -----END PGP SIGNATURE----- --qiufC9HJvalZPqFC--