Re: core dumps in auto_prewarm, tests succeed

Поиск
Список
Период
Сортировка
От Nathan Bossart
Тема Re: core dumps in auto_prewarm, tests succeed
Дата
Msg-id 20240122222743.GA2014482@nathanxps13
обсуждение исходный текст
Ответ на Re: core dumps in auto_prewarm, tests succeed  (Nathan Bossart <nathandbossart@gmail.com>)
Ответы Re: core dumps in auto_prewarm, tests succeed  (Nathan Bossart <nathandbossart@gmail.com>)
Re: core dumps in auto_prewarm, tests succeed  (Andres Freund <andres@anarazel.de>)
Re: core dumps in auto_prewarm, tests succeed  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Список pgsql-hackers
On Mon, Jan 22, 2024 at 03:38:15PM -0600, Nathan Bossart wrote:
> On Mon, Jan 22, 2024 at 01:24:54PM -0800, Andres Freund wrote:
>> On 2024-01-22 15:19:36 -0600, Nathan Bossart wrote:
>>> I think this is because the autoprewarm state was moved to a DSM segment,
>>> and DSM segments are detached before the on_shmem_exit callbacks are called
>>> during process exit.  Moving apw_detach_shmem to the before_shmem_exit list
>>> seems to resolve the crashes.
>> 
>> That seems plausible. Would still be nice to have at least this test ensure
>> that the shutdown code works. Perhaps just a check of the control file after
>> shutdown, ensuring that the state is "shutdowned" vs crashed?
> 
> I'll give that a try.  I'll also expand the comment above the
> before_shmem_exit() call.

Here is a patch.

This might be a topic for another thread, but I do wonder whether we could
put a generic pg_controldata check in node->stop that would at least make
sure that the state is some sort of expected shut-down state.  My first
thought is that it could be a tad expensive, but... maybe it wouldn't be
too bad.

-- 
Nathan Bossart
Amazon Web Services: https://aws.amazon.com

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Nathan Bossart
Дата:
Сообщение: Re: core dumps in auto_prewarm, tests succeed
Следующее
От: Christoph Berg
Дата:
Сообщение: Re: psql: Allow editing query results with \gedit