Re: [PATCH 3/8] Add support for a generic wal reading facility dubbed XLogReader

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: [PATCH 3/8] Add support for a generic wal reading facility dubbed XLogReader
Дата
Msg-id 201210301412.42667.andres@2ndquadrant.com
обсуждение исходный текст
Ответ на Re: [PATCH 3/8] Add support for a generic wal reading facility dubbed XLogReader  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Ответы Re: [PATCH 3/8] Add support for a generic wal reading facility dubbed XLogReader
Список pgsql-hackers
On Monday, October 29, 2012 08:58:53 PM Alvaro Herrera wrote:
> Heikki Linnakangas escribió:
> > Hmm. I was thinking that making this work in a non-backend context
> > would be too hard, so I didn't give that much thought, but I guess
> > there isn't many dependencies to backend functions after all.
> > palloc/pfree are straightforward to replace with malloc/free. That's
> > what we could easily do with the error messages too, just malloc a
> > suitably sized buffer.
> >
> > How does a non-backend program get access to xlogreader.c? Copy
> > xlogreader.c from the source tree at build time and link into the
> > program? Or should we turn it into a shared library?

> Andres commented elsewhere about reading xlog records, processing them
> as they came in, and do a running CRC while we're still reading it.  I
> think this is a mistake; we shouldn't do anything with a record until
> the CRC has been verified.  Otherwise we risk reading arbitrarily
> corrupt data.

Uhm. xlog.c does just the same. It reads the header and if it looks valid it
uses its length information to read the full record and only computes the CRC
at the end.

> Overall, I think I like Heikki's minimal patch better than Andres'
> original proposal, but I'll keep looking at both.

I'll defer to you two on that, no point in fighting that many experienced
people ;)

Andres

--
Andres Freund        http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services



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

Предыдущее
От: Hannu Krosing
Дата:
Сообщение: Re: What are the advantages of not being able to access multiple databases with one connection?
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: [PATCH 3/8] Add support for a generic wal reading facility dubbed XLogReader