Re: Recovery control functions

From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Simon Riggs <simon(at)2ndQuadrant(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Recovery control functions
Date: 2011-01-14 12:27:58
Message-ID: 4D30414E.8030509@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 14.01.2011 14:18, Simon Riggs wrote:
> On Fri, 2011-01-14 at 14:08 +0200, Heikki Linnakangas wrote:
>> On 14.01.2011 14:01, Simon Riggs wrote:
>>> On Fri, 2011-01-14 at 13:47 +0200, Heikki Linnakangas wrote:
>>>> On 14.01.2011 13:15, Simon Riggs wrote:
>>>>> /*
>>>>> + * Recheck shared recoveryPause by polling.
>>>>> + *
>>>>> + * XXX It might seem we should do this via a shared Latch, but
>>>>> + * currently we only support one shared latch per process and
>>>>> + * that is already taken for Startup process. Polling is used
>>>>> + * in other places in xlog.c already, so not a concern.
>>>>> + */
>>>>
>>>> There is no such limitation with latches.
>>>
>>> SIGUSR1 handler can only handle one shared latch
>>
>> You can only *wait* for one latch at a time, but you can own more than
>> that. AFAICS you would never need to wait for the recovery-pause-latch
>> at the same time as the other latch.
>
> Yes, I understand.
>
> Trouble is, if you wait on Latch X and other processes send wakeup
> assuming you were waiting on Latch Y, then this will erroneously wake
> you up.

The signal will wake up the process, but WaitLatch will quickly go back
to sleep if it wasn't for the latch we're waiting for. I don't think
that causes any meaningful performance issues.

So that's all handled within the latch code.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2011-01-14 12:30:03 Re: Re: [COMMITTERS] pgsql: Exit from base backups when shutdown is requested
Previous Message Simon Riggs 2011-01-14 12:25:03 Re: [COMMITTERS] pgsql: Exit from base backups when shutdown is requested