Re: Latest version of Hot Standby patch

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема Re: Latest version of Hot Standby patch
Дата
Msg-id 4965D189.3020700@enterprisedb.com
обсуждение исходный текст
Ответ на Re: Latest version of Hot Standby patch  (Simon Riggs <simon@2ndQuadrant.com>)
Ответы Re: Latest version of Hot Standby patch  (Simon Riggs <simon@2ndQuadrant.com>)
Список pgsql-hackers
Simon Riggs wrote:
> On Wed, 2009-01-07 at 22:08 +0000, Simon Riggs wrote:
>> On Wed, 2009-01-07 at 23:56 +0200, Heikki Linnakangas wrote:
>>> Simon Riggs wrote:
>>>> On Wed, 2009-01-07 at 15:43 +0200, Heikki Linnakangas wrote:
>>>>> When there's no xids in the procarray, couldn't we just use 
>>>>> latestCompletedXid instead of calling ReadNewTransactionId()?
>>>> latestCompletedXid is protected by ProcArrayLock so not much difference
>>>> between those two.
>>> The big difference is that we're already holding ProcArrayLock. You 
>>> could read the value of latestCompletedXid before releasing 
>>> ProcArrayLock, and wouldn't need the retry logic.
>> Sounds good to me then. Will rework.
> 
> Applies brakes suddenly.
> 
> I realise this is subtle trap I almost fell into the first time I coded
> it. The function is retrieving GetRunningTransactionData() and so we are
> interested in the latest running xid, not the latest completed xid. The
> latter is sufficient for snapshots, but the information derived by
> GetRunningTransactionData() is used to maintain UnobservedXids.

If there's no transactions running, latest completed xid is just what we 
need. When there is any transactions in procarray, we should take the 
max xid of those, as the patch already does.

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


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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Python 3.0 does not work with PL/Python
Следующее
От: "Hitoshi Harada"
Дата:
Сообщение: Sample of user-define window function and other things