Re: Proposal for CSN based snapshots

Поиск
Список
Период
Сортировка
От Greg Stark
Тема Re: Proposal for CSN based snapshots
Дата
Msg-id CAM-w4HPQ2jMXcbz83oFx=dvoxjHFm73W9PN4x3dJ6heWxFNZ=Q@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Proposal for CSN based snapshots  (Heikki Linnakangas <hlinnakangas@vmware.com>)
Ответы Re: Proposal for CSN based snapshots  (Ants Aasma <ants@cybertec.at>)
Список pgsql-hackers
On Mon, May 12, 2014 at 2:56 PM, Heikki Linnakangas
<hlinnakangas@vmware.com> wrote:
> Currently, before consulting the clog for an XID's status, it is necessary
> to first check if the transaction is still in progress by scanning the proc
> array. To get rid of that requirement, just before writing the commit record
> in the WAL, the backend will mark the clog slot with a magic value that says
> "I'm just about to commit". After writing the commit record, it is replaced
> with the record's actual LSN. If a backend sees the magic value in the clog,
> it will wait for the transaction to finish the insertion, and then check
> again to get the real LSN. I'm thinking of just using XactLockTableWait()
> for that. This mechanism makes the insertion of a commit WAL record and
> updating the clog appear atomic to the rest of the system.


Would it be useful to store the current WAL insertion point along with
the "about to commit" flag so it's effectively a promise that this
transaction will commit no earlier than XXX. That should allow most
transactions to decide if those records are visible or not unless
they're very recent transactions which started in that short window
while the committing transaction was in the process of committing.

-- 
greg



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

Предыдущее
От: Ants Aasma
Дата:
Сообщение: Re: Proposal for CSN based snapshots
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: Re: Proposal for CSN based snapshots