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

From Bertrand Drouvot
Subject Re: Restart pg_usleep when interrupted
Date
Msg-id Zrrx/K1Z06M3Mqrw@ip-10-97-1-34.eu-west-3.compute.internal
Whole thread Raw
In response to Re: Restart pg_usleep when interrupted  (Nathan Bossart <nathandbossart@gmail.com>)
List pgsql-hackers
Hi,

On Mon, Aug 12, 2024 at 05:04:02PM -0500, Nathan Bossart wrote:
> 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.

Yeah, that was mainly to avoid the side effect of the interrupts making the 
vacuum faster as compared to the master branch (as in [0], the leader is not
honouring the delays when the parallel workers report their delayed time): that
could be noticeable depending of the amount of work and the number of parallel
workers involved in the vacuum.

That could be solved thanks to this thread. Once this thread is over (and whatever
the outcome is), I'll resume my testing as far the cost delay report is concerned.

> I guess the unavoidable
> question is whether this work is still worthwhile given that improvement.

The delay not being honored already affects the vacuum since we allow a parallel
worker to report progress to the leader (see [1]). The interrupts are far less
frequent (as compare to [1]) though.

[0]: https://commitfest.postgresql.org/49/5027/
[1]: https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=f1889729dd

Regards,

-- 
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com



pgsql-hackers by date:

Previous
From: Ayush Tiwari
Date:
Subject: Drop database command will raise "wrong tuple length" if pg_database tuple contains toast attribute.
Next
From: Thomas Munro
Date:
Subject: Thread-safe nl_langinfo() and localeconv()