Thread: Utilisation of get_page_from_raw() in pageinspect

Utilisation of get_page_from_raw() in pageinspect

From
Ashutosh Sharma
Date:
Hi All,

Currently, get_page_from_raw() is not used in the pageinspect
functions for btree and heap to fetch a page image from raw page.
However, the pageinspect for gin and hash is using it to avoid server
crash on alignment picky machines with MAXALIGN = 8. Shouldn't we
start using it in the pageinspect functions for btree and heap as well
for safety purpose. Thoughts?

-- 
With Regards,
Ashutosh Sharma
EnterpriseDB:http://www.enterprisedb.com


Re: Utilisation of get_page_from_raw() in pageinspect

From
Jesper Pedersen
Date:
Hi Ashutosh,

On 06/27/2018 05:01 AM, Ashutosh Sharma wrote:
> Currently, get_page_from_raw() is not used in the pageinspect
> functions for btree and heap to fetch a page image from raw page.
> However, the pageinspect for gin and hash is using it to avoid server
> crash on alignment picky machines with MAXALIGN = 8. Shouldn't we
> start using it in the pageinspect functions for btree and heap as well
> for safety purpose. Thoughts?
> 

Although it is assumed that the functions are called using 
get_page_from_raw(), as shown by Peter's tests in adfb81d9e1d, I think 
it couldn't hurt to add an extra check, like in bt_page_items_bytea() 
and heap_page_items().

I can help with a review.

Best regards,
  Jesper