Re: Postmaster doesn't send SIGTERM to bgworker during fast shutdown when pmState == PM_STARTUP

From: Alexander Kukushkin <cyberdemn(at)gmail(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Postmaster doesn't send SIGTERM to bgworker during fast shutdown when pmState == PM_STARTUP
Date: 2018-08-29 07:09:08
Message-ID: CAFh8B=k_X7z_r3d3kmeorrzcdW4f_5U_iKAtGCgih0nVLxprCA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

2018-08-29 1:24 GMT+02:00 Michael Paquier <michael(at)paquier(dot)xyz>:

> I have been studying your patch, but it seems to me that this is not
> complete as other processes could have been started before switching
> from PM_STARTUP to PM_RECOVERY. I am talking here about the bgwriter
> and the checkpointer as well. Shouldn't we switch pmState to
> PM_WAIT_BACKENDS? Your patch is missing that.

Yeah, good catch, it starts checkpointer, bgwriter and in some cases
even archiver processes (when archive_mode=always) while pmState is
still equaled PM_START.
Please find attached the new version of the fix.

Regards,
--
Alexander Kukushkin

Attachment Content-Type Size
fast_shutdown_bgworker_v2.patch text/x-patch 516 bytes

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Mariel Cherkassky 2018-08-29 07:28:15 Re: Catalog corruption
Previous Message Alexander Kukushkin 2018-08-29 06:59:16 Re: BUG #15346: Replica fails to start after the crash