Re: Restart pg_usleep when interrupted - Mailing list pgsql-hackers

From Nathan Bossart
Subject Re: Restart pg_usleep when interrupted
Date
Msg-id Zr5veViqvtCUeUwp@nathan
Whole thread Raw
In response to Re: Restart pg_usleep when interrupted  (Bertrand Drouvot <bertranddrouvot.pg@gmail.com>)
Responses Re: Restart pg_usleep when interrupted
Re: Restart pg_usleep when interrupted
List pgsql-hackers
On Wed, Aug 14, 2024 at 06:00:06AM +0000, Bertrand Drouvot wrote:
> I gave it more thoughts and I don't think we have to choose between the two.
> The 1 Hz approach reduces the number of interrupts and Sami's patch provides a
> way to get "accurate" delay in case of interrupts. I think both have their own
> benefit. 

Is it really that important to delay with that level of accuracy?  In most
cases, the chances of actually interrupting a given vacuum delay point are
pretty small.  Even in the extreme scenario you tested with ~350K
interrupts in a 19 minute vacuum, you only saw a 10-15% difference in total
time.  I wouldn't say I'm diametrically opposed to this patch, but I do
think we need to carefully consider whether it's worth the extra code.

Separately, I've been wondering whether it's worth allowing the sleep to be
interrupted in certain cases, such as SIGINT and SIGTERM.  That should
address one of Heikki's points.

-- 
nathan



pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Partial aggregates pushdown
Next
From: Peter Geoghegan
Date:
Subject: Re: Showing primitive index scan count in EXPLAIN ANALYZE (for skip scan and SAOP scans)