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 1lvtrl-000649-CW for pgsql-hackers@arkaria.postgresql.org; Wed, 23 Jun 2021 03:47:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lvtrk-0004AH-Af for pgsql-hackers@arkaria.postgresql.org; Wed, 23 Jun 2021 03:47:52 +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 1lvtri-00043R-Vo for pgsql-hackers@lists.postgresql.org; Wed, 23 Jun 2021 03:47:52 +0000 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lvtrg-0002fx-6b for pgsql-hackers@postgresql.org; Wed, 23 Jun 2021 03:47:50 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 98CB6F62; Tue, 22 Jun 2021 23:47:45 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Tue, 22 Jun 2021 23:47:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm2; bh=dg32STn59HAYFv08hpWddpJHt8i JIlbfOdNtpmgb/Wc=; b=eKpS9RMaVCtP7ToaYAYMEtXetjLwt27F2QJ+YCtTCuj yipccMyuvkYfY/MK1QqXIRcBgkFFc78tTkg90xZA6vpQpUKe8k4ko9QS2sOcKqS3 TBQzzi7/Ss8HngkXafu3lgSrrGus8SpFjBx6N3/S+m/3+yAp9rbAI+Sr8CJk2+If MH7BM/TfZOCOk9UMaDzPcgiEXoABqzZYXV5KBQfbFpPP1EPXRLc9RkHHEufJBHkz Gt5EZ+rzgYv6pDbS+EoDNAg2T2PrFQ/subcsZQ0gN+TG+DWdO/r6pRIiP+br2WsY c5VxY8SpVD81CE0BkkxlWdoVE+4cddhhKET4nVVUp6Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=dg32ST n59HAYFv08hpWddpJHt8iJIlbfOdNtpmgb/Wc=; b=GiKwvCeoo3EqJtQH3JEY5h k0W7Mg4yH99JnyMPlB9SZM9fEJ7tphHUDCBQVzl3moVun3O9Few6bgvihQyBM272 FfsSCk71syvh/csh5ja9mX7rwtjhXgfnzK9I9dWu7L9W+vYo3d3erBdAj+b4bzmV ej8l6jcXm5XmsxHLhfgls/49uswXo2reTPLiZo1HgsK7UtI4N9FwggtzQioo5IOc n9LPnqTEftsz/fLi65Kr8+wRFTUrS8HgWLw/d9ta7t+xdluv0Y2OqsfpqSSi2WMV bl6S0Yit4yEwM2hqgO0aBdg0kOyo1Z589Pa4BHEF1lrWmjyZCbcgGXCNlYu0U2Og == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrfeegvddgieejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdljedtmdenucfjughrpeffhffvuffkfhggtggujgesghdtreertddt vdenucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprg hquhhivghrrdighiiiqeenucggtffrrghtthgvrhhnpedvgeduuefhtdeuleettdevjeeh heeiveeuieegleetgeeljeelieeuieehgeevhfenucevlhhushhtvghrufhiiigvpedtne curfgrrhgrmhepmhgrihhlfhhrohhmpehmihgthhgrvghlsehprghquhhivghrrdighiii X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 22 Jun 2021 23:47:41 -0400 (EDT) Date: Wed, 23 Jun 2021 12:47:37 +0900 From: Michael Paquier To: Fabien COELHO Cc: Andrew Dunstan , Thomas Munro , Alvaro Herrera , Gregory Smith , PostgreSQL-development , david.christensen@crunchydata.com Subject: Re: pgbench logging broken by time logic changes Message-ID: References: <202106200318.gxnon4vrc7t6@alvherre.pgsql> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="5sELj4OZC4KLemhA" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --5sELj4OZC4KLemhA Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Jun 22, 2021 at 12:06:45PM +0200, Fabien COELHO wrote: > Attached an updated v8 patch which adds (reinstate) an improved TAP test > which would have caught the various regressions on logs. > Given that such tests were removed once before, I'm unsure whether they will > be acceptable, despite that their usefulness has been clearly demonstrated. > At least it is for the record. Sigh:-( Thanks! This v8 is an addition of the fix for the epoch with the adjustments for the aggregate reports in the logs. The maths look rather right after a read and after some tests. +# note: this test is time sensitive, and may fail on a very +# loaded host. +# note: --progress-timestamp is not tested +my $delay = pgbench( + '-T 2 -P 1 -l --aggregate-interval=1 -S -b se@2' + . ' --rate=20 --latency-limit=1000 -j ' . $nthreads + . ' -c 3 -r', + 0, + [ qr{type: multiple}, + qr{clients: 3}, + qr{threads: $nthreads}, + qr{duration: 2 s}, + qr{script 1: .* select only}, + qr{script 2: .* select only}, + qr{statement latencies in milliseconds}, + qr{FROM pgbench_accounts} ], + [ qr{vacuum}, qr{progress: 1\b} ], + 'pgbench progress', undef, + "--log-prefix=$bdir/001_pgbench_log_1"); Could we make that shorter at 1s? That will shorten the duration of the test run. It is easy to miss that this test is for --aggregate-interval (aka the logAgg() path) without a comment. +# cool check that we are around 2 seconds +# The rate may results in an unlucky schedule which triggers +# an early exit, hence the loose bound. +ok(0.0 < $delay && $delay < 4.0, "-T 2 run around 2 seconds"); The command itself would not fail, but we would just fail on a machine where the difference in start/stop time is higher than 4 seconds, right? On RPI-level machines, this could fail reliably. I am not completely sure what's the additional value we can get from that extra test, to be honest. +# $nthreads threads, 2 seconds, but due to timing imprecision we might get +# only 1 or as many as 3 progress reports per thread. +check_pgbench_logs($bdir, '001_pgbench_log_1', $nthreads, 1, 3, + qr{^\d{10,} \d{1,2} \d+ \d+ \d+ \d+ \d+ \d+ \d+ \d+ \d+$}); + Now this one is good and actually stable thanks to the fact that we'd get at least the final logs, and the main complain we got to discuss about on this thread was the format of the logs. I would say to give up on the first test, and keep the second. But, is this regex correct? Shouldn't we check for six integer fields only with the first one having a minimal number of digits for the epoch? -- Michael --5sELj4OZC4KLemhA Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmDSrtgACgkQnvQgOdby QH22UBAAmyhrDLkubNCBb19Ym5uXG5LK5Cb7OkKJXmOd5Q7DJAxQZo7U4tKNKHNu Wb/GRBVxg02embDjU0ZnND+aEKCbqok9CNY7T231fK3MX2oPm6XmIMz7K3aXR5qE oa+/jkS3vGipQj9qAioi4eGH8N+P68iDM2gPzNO/uP2SJYUqp57ZL/U+PDf81BFS 51DGOhf4sKcmmxMrQX3J1r9bVdVS5cevSq0+Mg8g3wvmvhlR9uCUust8wlnNCCYr GJfW1k6UWXivu76ezTaa8UchIBswSQD7rPFDv2DrGqB/k4RFWblpseYdYOz6W82i EOPWraKQ3NviMtmqWH2klFil2ToMu9J17ZPKA6GC1oIhoURYHs5gqeGV2WpBjkIj 7VCnWgzdl6RqG4BF6D/eGmyOG3x3aHbey+aBS49jBb8KomHqzdrQYqD3AOT3NoGN vohGx9o+cLYB1PUkXD5+0NLMt42R8VeohHxqwuU85a7ecakL4ZsFDPv2fQZiQKxK qgHazs16iAW2iC6D6zgIO2ELWAHSPYOxPk4NIx8cGyUKnoywQLRSblcvNB6Q+xO6 niax5iiyeHjEUdK6xbZXtDBx2ALc+6mqJr3tZ0btJUd556qBlxc1UGRxfvO1AMPc 5f8fAbLshWgavYjvOsyhY1x5c1yznX6tTWkchP5z5M5OgmqFtTE= =IwvU -----END PGP SIGNATURE----- --5sELj4OZC4KLemhA--