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 1kdA8l-0003TD-EQ for pgsql-hackers@arkaria.postgresql.org; Thu, 12 Nov 2020 10:47:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kdA8j-0005TG-NE for pgsql-hackers@arkaria.postgresql.org; Thu, 12 Nov 2020 10:47:41 +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 1kdA8j-0005T9-3f for pgsql-hackers@lists.postgresql.org; Thu, 12 Nov 2020 10:47:41 +0000 Received: from mail.postgrespro.ru ([93.174.131.139]) by makus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kdA8f-0005Aa-Tc for pgsql-hackers@lists.postgresql.org; Thu, 12 Nov 2020 10:47:39 +0000 Received: from mail.postgrespro.ru (cyclops.postgrespro.ru [93.174.131.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mail.postgrespro.ru (Postfix) with ESMTPSA id D17E821C29E1; Thu, 12 Nov 2020 13:47:34 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mail; t=1605178054; bh=ft8aLU8Ar8zaCdndJkEo8LSM93h7dsaoy3wYmfGubmE=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=YZuTB3LKrimC6OXbNr5bg09r0Uxjoydbn0ksCigfAeoxaEnIAJgUTIpaIf9S6vMdc 62i0LjQkbSwmaquUgihOP8nZSwKKlbBoyrOpxUbT9y7t9Ga8kfsrPW9UOZ3qD4spGM R3paHdvdycD+ncieKTFf6Ks994Zqoh7LFQlDiLYU= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Thu, 12 Nov 2020 13:47:34 +0300 From: Alexey Kondratov To: Tom Lane Cc: PostgreSQL Hackers Subject: Re: Misuse of TimestampDifference() in the autoprewarm feature of pg_prewarm In-Reply-To: <2464589.1605067173@sss.pgh.pa.us> References: <3b1c053a21c07c1ed5e00be3b2b855ef@postgrespro.ru> <1992985.1604948005@sss.pgh.pa.us> <1996862.1604953516@sss.pgh.pa.us> <01241062b6bfea2f17e32a65a4f99d61@postgrespro.ru> <2464589.1605067173@sss.pgh.pa.us> User-Agent: Roundcube Webmail/1.4.0 Message-ID: <221de228fbf0c801e335bd3bcc661a31@postgrespro.ru> X-Sender: a.kondratov@postgrespro.ru List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2020-11-11 06:59, Tom Lane wrote: > 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. > Great, thank you for generalisation of the issue and working on it. Regards -- Alexey Kondratov Postgres Professional https://www.postgrespro.com Russian Postgres Company