Re: Proposal to add page headers to SLRU pages - Mailing list pgsql-hackers

From Li, Yong
Subject Re: Proposal to add page headers to SLRU pages
Date
Msg-id F9C587A3-E707-4C4E-9E83-124D963C85BA@ebay.com
Whole thread Raw
In response to Re: Proposal to add page headers to SLRU pages  (Jeff Davis <pgsql@j-davis.com>)
Responses Re: Proposal to add page headers to SLRU pages
List pgsql-hackers
>> - New comments have been added to pg_upgrade to mention the SLRU
>>  page header change as the reason for upgrading clog files.
> 
> That seems reasonable, but were any alternatives discussed? Do we have
> consensus that this is the right thing to do?

In general, there are two approaches. Either we convert the existing clog files,
or we don’t.  The patch chooses to convert.

If we don’t, then the clog file code must be able to handle both formats. For,
XIDs in the range where the clog is written in the old format, segment and offset
computation must be done in one way, and for XIDs in a different range, it must
be computed in a different way.  To avoid changing the format in the middle of a
page, which must not happen, the new format must start from a clean page, 
possibly in a clean new segment.  If the database is extremely small and has only
a few transactions on the first page of clog, then we must either convert the whole
page (effectively the whole clog file), or we must skip the rest of the XIDs on the
page and ask the database to start from XIDs on the second page on restart.
Also, we need to consider where to store the cut-off XID and when to remove it.
All these details feel very complex and error prone to me.  Performing a one-time
conversion is the most efficient and straightforward approach to me. 

> 
> And if we use this approach, is there extra validation or testing that
> can be done?
> 
> Regards,
>        Jeff Davis

Unfortunately, the test requires a setup of two different versions of PG. I am not
aware of an existing test infrastructure which can run automated tests using two
PGs. I did manually verify the output of pg_upgrade. 


Regards,
Yong


pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: What about Perl autodie?
Next
From: Amit Kapila
Date:
Subject: Re: speed up a logical replica setup