Re: Can a child process detect postmaster death when in pg_usleep?

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
Cc: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Can a child process detect postmaster death when in pg_usleep?
Date: 2021-07-02 04:22:53
Message-ID: YN6UnaLBTQH+2v4Y@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Jun 28, 2021 at 08:21:06PM +0530, Bharath Rupireddy wrote:
> The recoveryWakeupLatch and procLatch/MyLatch are being used for WAL
> replay and recovery conflict, respectively. Actually, I was earlier
> using procLatch/MyLatch, but came across the commit 00f690a23 which
> says that the two latches are reserved for specific purposes. I'm not
> quite sure which one to use when do_pg_stop_backup is called by the
> startup process. Any thoughts?

Could you explain why you think dp_pg_stop_backup() can be called by
the startup process? AFAIK, this code path applies to two categories
of sessions:
- backend sessions, with the SQL functions calling this routine.
- WAL senders, aka anything that connects with replication=1 able to
use the BASE_BACKUP with the replication protocol.

> Thanks. Please let me know if there are any comments on
> v1-0001-Use-a-WaitLatch-for-lock-waiting-in-lazy_truncate.patch.

Applied this one as that's clearly a win. The event name has been
renamed to VacuumTruncate.
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Craig Ringer 2021-07-02 04:34:13 Re: Detecting File Damage & Inconsistencies
Previous Message Michael Paquier 2021-07-02 04:20:21 Re: ERROR: "ft1" is of the wrong type.