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

From Nathan Bossart
Subject Re: Restart pg_usleep when interrupted
Date
Msg-id ZrqG0tIgP2HbGRm1@nathan
Whole thread Raw
In response to Re: Restart pg_usleep when interrupted  (Heikki Linnakangas <hlinnaka@iki.fi>)
Responses Re: Restart pg_usleep when interrupted
Re: Restart pg_usleep when interrupted
List pgsql-hackers
On Tue, Aug 13, 2024 at 12:04:28AM +0300, Heikki Linnakangas wrote:
>> In the case of the patch being proposed by Bertrand, the number of
>> interrupts > will be much more frequent as parallel workers would send a
>> message
> to the leader
>> to update the vacuum delay counters every vacuum_delay_point call.
> 
> Hmm, I wonder if that's a good design, if it results in a lot of interrupts.

Skimming the last few messages of that thread [0], it looks like Bertrand
is exploring ways to avoid so many interrupts.  I guess the unavoidable
question is whether this work is still worthwhile given that improvement.

> On the patch itself: Making the sleeps in vacuum uninterruptible means that
> vacuum will be more slow to respond to interrupts. If you SIGTERM a vacuum
> process, or hit CTRL-C, you *would* want to exit the sleep ASAP.

Since the delay will typically be pretty small (2 milliseconds by default
for autovacuum), I'm assuming this won't ordinarily be noticeable.  But I
do think it is an important consideration.

[0] https://commitfest.postgresql.org/49/5027/

-- 
nathan



pgsql-hackers by date:

Previous
From: "Euler Taveira"
Date:
Subject: Re: [Patch] add new parameter to pg_replication_origin_session_setup
Next
From: "Imseih (AWS), Sami"
Date:
Subject: Re: Restart pg_usleep when interrupted