Re: POC: Cleaning up orphaned files using undo logs

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: POC: Cleaning up orphaned files using undo logs
Дата
Msg-id CA+Tgmob6d4OXYkpR=1YTEPtoKiPqHQDw2iwEFqz4PMAP4y3v7g@mail.gmail.com
обсуждение исходный текст
Ответ на Re: POC: Cleaning up orphaned files using undo logs  (Dilip Kumar <dilipbalaut@gmail.com>)
Список pgsql-hackers
On Mon, May 6, 2019 at 8:13 AM Dilip Kumar <dilipbalaut@gmail.com> wrote:
> > In general, I find the code for updating transaction headers to be
> > really hard to understand.  I'm not sure exactly what can be done
> > about that.  Like, why is UndoRecordPrepareTransInfo unpacking undo?
>
> It's only unpacking header.  But, yeah we can do better, instead of
> unpacking we can just read the main header and from uur_info we can
> calculate exact offset of the uur_next and in
> UndoRecordUpdateTransInfo we can directly update only uur_next by
> writing at that offset, instead of overwriting the complete header?

Hmm.  I think it's reasonable to use the unpack infrastructure to
figure out where uur_next is.  I don't know whether a bespoke method
of figuring that out would be any better.  At least the comments
probably need some work.

> > Why does it take two undo record pointers as arguments and how are
> > they different?
> One is previous transaction's start header which we wants to update
> and other is current transaction's urec pointer what we want to set as
> uur_next in the previous transaction's start header.

So put some comments.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: Unhappy about API changes in the no-fsm-for-small-rels patch
Следующее
От: Julien Rouhaud
Дата:
Сообщение: Re: reindexdb & clusterdb broken against pre-7.3 servers