Re: I/O worker and ConfigReload

From: Dmitry Dolgov <9erthalion6(at)gmail(dot)com>
To: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org, Andres Freund <andres(at)anarazel(dot)de>
Subject: Re: I/O worker and ConfigReload
Date: 2025-05-24 14:34:37
Message-ID: holn4omukvvk5fvaspuboxjcwk5aj5fdct62u7irypvusiusxu@gbyxqkolbdzn
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On Sun, May 25, 2025 at 02:15:12AM GMT, Thomas Munro wrote:
> On Sun, May 25, 2025 at 1:56 AM Dmitry Dolgov <9erthalion6(at)gmail(dot)com> wrote:
> > I've been rebasing the patch for online resizing of shared memory, and
> > noticed something strange about IoWorkerMain: although it sets the
> > handler SignalHandlerForConfigReload, it doesn't look like it acts upon
> > ConfigReloadPending. From what I see it happens because it only does
> > CHECK_FOR_INTERRUPTS in the main worker loop, which doesn't handle
> > ConfigReloadPending.
> >
> > In the context of shared memory resizing patch it means I/O workers are
> > not receiving the new value of NBuffers and crash. Adding something like
> > pgaio_worker_process_interrupts to deal with ConfigReloadPending at the
> > beginning of the main worker loop seems to solve the issue. But I
> > haven't found any discussion about config reload in I/O workers, was
> > this omission intentional?
>
> You're right, and I noticed the same thing and fixed it in
> 0004-aio-Adjust-IO-worker-pool-size-automatically.patch in
> https://www.postgresql.org/message-id/flat/CA%2BhUKG%2Bm4xV0LMoH2c%3DoRAdEXuCnh%2BtGBTWa7uFeFMGgTLAw%2BQ%40mail.gmail.com.
> (That patch also introduces a reason for the workers to care about
> config reload.). Not sure how that happened, ie the history of
> adding/removing reasons to worry about reload, I don't remember, this
> code stewed for a long time, but it's at least inconsistent... We
> could fix it as you suggested or as shown in that patch.

I see thanks. Indeed, there isn't much difference between what I had in
mind and the relevant bits in 0004, so probably it's the way to go.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Sami Imseih 2025-05-24 14:35:24 Re: queryId constant squashing does not support prepared statements
Previous Message Thomas Munro 2025-05-24 14:15:12 Re: I/O worker and ConfigReload