Re: log_newpage header comment

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: log_newpage header comment
Дата
Msg-id CA+TgmobondAWvFbtouhwmMy4Y3P50=6JA6C_ek3x7V1bVt4PRg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: log_newpage header comment  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: log_newpage header comment  (Robert Haas <robertmhaas@gmail.com>)
Re: log_newpage header comment  (Amit kapila <amit.kapila@huawei.com>)
Список pgsql-hackers
On Fri, Jun 8, 2012 at 9:56 AM, Robert Haas <robertmhaas@gmail.com> wrote:
> OK.  So what I'm thinking is that we should add a new function that
> takes a relfilenode and a buffer and steps 4-6 of what's described in
> transam/README: mark the buffer dirty, xlog it, and set the LSN and
> TLI.  We might want to have this function assert that it is in a
> critical section, for the avoidance of error.  Then anyone who wants
> to use it can do steps 1-3, call the function, and then finish up with
> steps 6-7.  I don't think we can cleanly encapsulate any more than
> that.

On further review, I think that we ought to make MarkBufferDirty() the
caller's job, because sometimes we may need to xlog only if
XLogIsNeeded(), but the buffer's got to get marked dirty either way.
So I think the new function should just do step 5 - emit XLOG and set
LSN/TLI.

Proposed patch attached.

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

Вложения

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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: Checkpointer on hot standby runs without looking checkpoint_segments
Следующее
От: Amit kapila
Дата:
Сообщение: WIP patch for Todo Item : Provide fallback_application_name in contrib/pgbench, oid2name, and dblink