Re: _bt_delitems: change before WAL?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: _bt_delitems: change before WAL?
Дата
Msg-id 19137.1215804693@sss.pgh.pa.us
обсуждение исходный текст
Ответ на _bt_delitems: change before WAL?  (Alvaro Herrera <alvherre@commandprompt.com>)
Список pgsql-hackers
Alvaro Herrera <alvherre@commandprompt.com> writes:
> It's often said that the golden rule of WAL is that we must log the
> changes before actually doing the changes.

No, the golden rule is that the log entry must hit disk before the
data-page changes do.  This does not speak to the order in which you
make the changes in memory.

> However it seems to me that
> in _bt_delitems we're modifying the page (calling PageIndexMultiDelete)
> before actually logging what's going to happen.  Why is this OK?

Because we have write lock on the buffer, which will prevent anyone else
from writing it out (or even looking at it).  This is exactly like all the
other WAL-logging actions; see the WAL coding rules in access/transam/README.
        regards, tom lane


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: 8.1 index corruption woes
Следующее
От: Zdenek Kotala
Дата:
Сообщение: Re: PATCH: CITEXT 2.0 v3