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 1kchIK-0001xB-MJ for pgsql-hackers@arkaria.postgresql.org; Wed, 11 Nov 2020 03:59:40 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kchIJ-0003i8-Iy for pgsql-hackers@arkaria.postgresql.org; Wed, 11 Nov 2020 03:59:39 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kchIJ-0003i0-By for pgsql-hackers@lists.postgresql.org; Wed, 11 Nov 2020 03:59:39 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kchIH-0004sO-AQ for pgsql-hackers@lists.postgresql.org; Wed, 11 Nov 2020 03:59:39 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 0AB3xXjv2464590; Tue, 10 Nov 2020 22:59:34 -0500 From: Tom Lane To: Alexey Kondratov cc: PostgreSQL Hackers , Robert Haas Subject: Re: Misuse of TimestampDifference() in the autoprewarm feature of pg_prewarm In-reply-to: <01241062b6bfea2f17e32a65a4f99d61@postgrespro.ru> References: <3b1c053a21c07c1ed5e00be3b2b855ef@postgrespro.ru> <1992985.1604948005@sss.pgh.pa.us> <1996862.1604953516@sss.pgh.pa.us> <01241062b6bfea2f17e32a65a4f99d61@postgrespro.ru> Comments: In-reply-to Alexey Kondratov message dated "Tue, 10 Nov 2020 19:58:44 +0300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2464588.1605067173.1@sss.pgh.pa.us> Date: Tue, 10 Nov 2020 22:59:33 -0500 Message-ID: <2464589.1605067173@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Alexey Kondratov writes: > After looking on the autoprewarm code more closely I have realised that > this 'double dump' issues was not an issues at all. I have just > misplaced a debug elog(), so its second output in the log was only > indicating that we calculated delay_in_ms one more time. Ah --- that explains why I couldn't see a problem. I've pushed 0001+0002 plus some followup work to fix other places that could usefully use TimestampDifferenceMilliseconds(). I have not done anything with 0003 (the TAP test for pg_prewarm), and will leave that to the judgment of somebody who's worked with pg_prewarm before. To me it looks like it's not really testing things very carefully at all; on the other hand, we have exactly zero test coverage of that module today, so maybe something is better than nothing. regards, tom lane