_bt_delitems: change before WAL?

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема _bt_delitems: change before WAL?
Дата
Msg-id 20080711170649.GE4110@alvh.no-ip.org
обсуждение исходный текст
Ответы Re: _bt_delitems: change before WAL?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Hi,

It's often said that the golden rule of WAL is that we must log the
changes before actually doing the changes.  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?

I see that we're holding the "super exclusive" lock on the page, but
does this promise that the bgwriter won't write the page early?  Another
thing that I notice is that the buffer is not marked dirty until much
later in btbulkdelete.  But what if the buffer was dirty beforehand?

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


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

Предыдущее
От: "Jaime Casanova"
Дата:
Сообщение: Re: Extending grant insert on tables to sequences
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: 8.1 index corruption woes