Re: explicit tracking of ActiveSnapshot

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: explicit tracking of ActiveSnapshot
Дата
Msg-id 20080414235753.GB11292@alvh.no-ip.org
обсуждение исходный текст
Ответ на explicit tracking of ActiveSnapshot  (Alvaro Herrera <alvherre@commandprompt.com>)
Список pgsql-patches
Alvaro Herrera wrote:

> In the previous installment,
> http://archives.postgresql.org/message-id/20080328140606.GL7464@alvh.no-ip.org
> I was wondering whether the tracking of snapshots could be made more
> robust by having ActiveSnapshot be some sort of stack instead of a
> global pointer.  So I set to do that, and it turns out to appear a sane
> thing to do.  Here is a patch.

Here is the combined patch, keeping track of both ActiveSnapshot as a
stack and snapshots registered on a list.  I figured out that the
easiest way to manage the memory is to keep track of reference counts in
the snapshot itself, separately for the active snapshot stack and the
registered list, so we know the earliest time to free it.

Open issues:

- SerializableSnapshot is not handled.  (I think this is just a matter
of adding a RegisterSnapshot call as soon as the serializable snapshot
is created).

- Creating the VacuumXmin stuff to actually use it, and decide what to
do with GetOldestXmin.


Comments are very welcome.

--
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

Вложения

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

Предыдущее
От: "Brendan Jurd"
Дата:
Сообщение: Removing typename from A_Const (was: Empty arrays with ARRAY[])
Следующее
От: Magnus Hagander
Дата:
Сообщение: Re: libpq Win32 Mutex performance patch