Re: I/O worker and ConfigReload

From: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
To: Dmitry Dolgov <9erthalion6(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:15:12
Message-ID: CA+hUKGK7Q1G-sryLf4--zkrHO1Hdao12HdAykZYoRnYerrdxnQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dmitry Dolgov 2025-05-24 14:34:37 Re: I/O worker and ConfigReload
Previous Message Hannu Krosing 2025-05-24 14:02:52 Re: [PATCH] Extending FK check skipping on replicas to ADD FK and TRUNCATE