Re: Avoiding unnecessary reads in recovery

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Avoiding unnecessary reads in recovery
Дата
Msg-id 25423.1177521613@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Avoiding unnecessary reads in recovery  ("Simon Riggs" <simon@2ndquadrant.com>)
Ответы Re: Avoiding unnecessary reads in recovery  (Heikki Linnakangas <heikki@enterprisedb.com>)
Re: Avoiding unnecessary reads in recovery  (Heikki Linnakangas <heikki@enterprisedb.com>)
Список pgsql-hackers
"Simon Riggs" <simon@2ndquadrant.com> writes:
> As regards the zero_damaged_pages question, I raised that some time ago
> but we didn't arrive at an explicit answer. All I would say is we can't
> allow invalid pages in the buffer manager at any time, whatever options
> we have requested, otherwise other code will fail almost immediately.

Yeah --- the proposed new bufmgr routine should probably explicitly zero
the content of the buffer.  It doesn't really matter in the context of
WAL recovery, since there can't be any concurrent access to the buffer,
but it'd make it safe to use in non-WAL contexts (I think there are
other places where we know we are going to init the page and so a
physical read is a waste of time).  Also, this would let the patch be

+    if (alloc_only)
+        MemSet...
+    else    smgrread...

and you don't need to hack out the PageHeaderIsValid test, since it will
allow zeroed pages.

Possibly ReadZeroedBuffer would be a better name?
        regards, tom lane


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

Предыдущее
От: Andrew Dunstan
Дата:
Сообщение: Re: ECPG failure on BF member Vaquita (Windows Vista)
Следующее
От: Tom Lane
Дата:
Сообщение: Re: ECPG failure on BF member Vaquita (Windows Vista)