Re: WAL format changes

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: WAL format changes
Дата
Msg-id 201206182045.53962.andres@2ndquadrant.com
обсуждение исходный текст
Ответ на Re: WAL format changes  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Ответы Re: WAL format changes  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Список pgsql-hackers
On Monday, June 18, 2012 08:32:54 PM Heikki Linnakangas wrote:
> On 18.06.2012 21:13, Andres Freund wrote:
> > On Monday, June 18, 2012 08:08:14 PM Heikki Linnakangas wrote:
> >> The page header contains an XLogRecPtr (LSN), so if we change it we'll
> >> have to deal with pg_upgrade. I guess we could still keep XLogRecPtr
> >> around as the on-disk representation, and convert between the 64-bit
> >> integer and XLogRecPtr in PageGetLSN/PageSetLSN. I can try that out -
> >> many xlog calculations would admittedly be simpler if it was an uint64.
> > 
> > I am out of my depth here, not having read any of the relevant code, but
> > couldn't we simply replace the lsn from disk with InvalidXLogRecPtr
> > without marking the page dirty?
> > 
> > There is the valid argument that you would loose some information when
> > pages with hint bits are written out again, but on the other hand you
> > would also gain the information that it was a hint-bit write...
> 
> Sorry, I don't understand that. Where would you "replace the LSN from
> disk with InvalidXLogRecPtr" ? (and no, it probably won't work ;-) )
In ReadBuffer_common or such, after reading a page from disk and verifying 
that the page has a valid header it seems to be possible to replace pd_lsn *in 
memory* by InvalidXLogRecPtr without marking the page dirty.
If the page isn't modified the lsn on disk won't be changed so you don't loose 
debugging information in that case. If will be zero if it has been written by 
a hint-bit write and thats arguable a win.

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


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

Предыдущее
От: Jeff Davis
Дата:
Сообщение: Re: initdb and fsync
Следующее
От: Jeff Davis
Дата:
Сообщение: Re: initdb and fsync