pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Heikki Linnakangas <hlinnaka@iki.fi>
To: Fujii Masao <masao.fujii@oss.nttdata.com>
To: Fujii Masao <fujii@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Get rid of the dedicated latch for signaling the startup process
Date: Wed, 4 Nov 2020 15:17:41 +0200
Message-ID: <b3265f23-f47c-6ab1-e0e7-2df0c3e4e9e1@iki.fi> (raw)
In-Reply-To: <d1260696-30a2-f386-633d-dafd6bc46bd9@oss.nttdata.com>
References: <E1kaDSl-0001GJ-05@gemulon.postgresql.org>
	<5c1f8a85-747c-7bf9-241e-dd467d8a3586@iki.fi>
	<c50bee3b-f7b6-1052-c161-699ec83fdf85@oss.nttdata.com>
	<d1260696-30a2-f386-633d-dafd6bc46bd9@oss.nttdata.com>

On 04/11/2020 14:03, Fujii Masao wrote:
>> I'm thinking to remove the following code to fix this issue. Thought?
>>
>>       /*
>>        * We don't need the latch anymore. It's not strictly necessary to reset
>>        * it to NULL, but let's do it for the sake of tidiness.
>>        */
>>       if (ArchiveRecoveryRequested)
>>           XLogCtl->recoveryWakeupLatch = NULL;

That should work, but it seems a bit sloppy to leave it pointing to a 
latch that belongs to a random process though.

> Or ISTM that WakeupRecovery() should set the latch only when the latch
> has not been reset to NULL yet.

Got to be careful with race conditions, if the latch is set to NULL at 
the same time that WakeupRecovery() is called.

- Heikki





view thread (9+ messages)  latest in thread

Message-ID: <b3265f23-f47c-6ab1-e0e7-2df0c3e4e9e1@iki.fi>
Permalink:  ../b3265f23-f47c-6ab1-e0e7-2df0c3e4e9e1@iki.fi/
Also on:    postgresql.org/message-id/b3265f23-f47c-6ab1-e0e7-2df0c3e4e9e1@iki.fi

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: hlinnaka@iki.fi, masao.fujii@oss.nttdata.com, fujii@postgresql.org
  Subject: Re: pgsql: Get rid of the dedicated latch for signaling the startup process
  In-Reply-To: <b3265f23-f47c-6ab1-e0e7-2df0c3e4e9e1@iki.fi>
  References: <E1kaDSl-0001GJ-05@gemulon.postgresql.org> <5c1f8a85-747c-7bf9-241e-dd467d8a3586@iki.fi> <c50bee3b-f7b6-1052-c161-699ec83fdf85@oss.nttdata.com> <d1260696-30a2-f386-633d-dafd6bc46bd9@oss.nttdata.com> <b3265f23-f47c-6ab1-e0e7-2df0c3e4e9e1@iki.fi>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox