Re: LogStandbySnapshot (was another thread)

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема Re: LogStandbySnapshot (was another thread)
Дата
Msg-id 4BE10C42.6050209@enterprisedb.com
обсуждение исходный текст
Ответ на LogStandbySnapshot (was another thread)  (Simon Riggs <simon@2ndQuadrant.com>)
Ответы Re: LogStandbySnapshot (was another thread)  (Simon Riggs <simon@2ndQuadrant.com>)
Список pgsql-hackers
Simon Riggs wrote:
> On Tue, 2010-05-04 at 13:23 -0400, Tom Lane wrote:
> 
>> * LogStandbySnapshot is merest fantasy: no guarantee that either the
>> XIDs list or the locks list will be consistent with the point in WAL
>> where it will get inserted.  What's worse, locking things down enough
>> to guarantee consistency would be horrid for performance, or maybe
>> even deadlock-inducing. Could lose both ways: list might contain an
>> XID whose commit/abort went to WAL before the snapshot did, or list
>> might be missing an XID started just after snap was taken, The latter
>> case could possibly be dealt with via nextXid filtering, but that
>> doesn't fix the former case, and anyway we have both ends of the same
>> problem for locks.
> 
> This was the only serious complaint on your list, so lets address it.
> 
> Clearly we don't want to lock everything down, for all the reasons you
> say. That creates a gap between when data is derived and when data
> logged to WAL.

Right. This was discussed first in August:
http://archives.postgresql.org/message-id/4A8CE561.4000302@enterprisedb.com.

I concur that the idea is that we deal at replay with the fact that the
snapshot lags behind. At replay, any locks/XIDs in the snapshot that
have already been committed/aborted are ignored. For any locks/XIDs
taken just after the snapshot was taken, the replay will see the other
WAL records with that information.

We need to add comments explaining all that.

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


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

Предыдущее
От: Alex Hunsaker
Дата:
Сообщение: Re: buildfarm building all live branches from git
Следующее
От: "Joshua D. Drake"
Дата:
Сообщение: Re: max_standby_delay considered harmful