Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql Hackers > Proposal: Multi...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 15 Topic 9511 of 10966
Post > Topic >>

Proposal: Multiversion page api (inplace upgrade)

by Zdenek.Kotala@[EMAIL PROTECTED] (Zdenek Kotala) Jun 11, 2008 at 04:11 PM

1) Overview

This proposal is part of inplace upgrade project. PostgreSQL should be
able to 
read any page in old version. This is basic for all possible upgrade
method.


2) Background

We have several macros for manipulating of the page structures but this
list is 
not complete and many parts of code access into this structures directly
and 
severals part does not use existing macros. The idea is to use only
specified 
API for manipulation/access of data structure on page. This API will
recognize 
page layout version and it process data correctly.


3) API

Proposed API is extended version of current macros which does not satisfy
all 
Page Header manipulation. I plan to use function in first implementation, 
because it offers better type control and debugging capability, but some 
functions could be converted into macros (or into inline functions) in
final 
solution (performance improving). All changes are related to bufpage.h and
page.c.


4) Implementation

The main point of implementation is to have several version of PageHeader 
structure (e.g. PageHeader_04, PageHeader_03 ...) and correct structure
will be 
handled in special branch (see examples).

Possible improvement is to use union which combine different PageHeader
version 
and because most PageHeader items are same for all Page Layout version, it
will 
reduce number of switches. But I'm afraid if union have same data layout
as 
separate structure on all sup****ted platforms.

There are examples:

void PageSetFull(Page page)
{
	switch ( PageGetPageLayoutVersion(page) )
	{
		case 4 : ((PageHeader_04) (page))->pd_flags |= PD_PAGE_FULL;
				  break;
		default elog(PANIC, "PageSetFull is not sup****ted on page layout version
%i",
				PageGetPageLayoutVersion(page));
	}
}

LocationIndex PageGetLower(Page page)
{
	switch ( PageGetPageLayoutVersion(page) )
	{
		case 4 : return ((PageHeader_04) (page))->pd_lower);
	}
	elog(PANIC, "Unsup****ted page layout in function PageGetLower.");
}


5) Issues

  a) hash index has hardcoded PageHeader into meta page structure -> need 
rewrite hash index implementation to be multiheader version friendly
  b) All *ItemSize macros (+toast chunk size) depends on
sizeof(PageHeader) -> 
separate proposal will follow soon.


	All comments are welcome.

		Zdenek


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@[EMAIL PROTECTED]
)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
 




 15 Posts in Topic:
Proposal: Multiversion page api (inplace upgrade)
Zdenek.Kotala@[EMAIL PROT  2008-06-11 16:11:59 
Re: Proposal: Multiversion page api (inplace upgrade)
tgl@[EMAIL PROTECTED] (T  2008-06-11 10:56:08 
Re: Proposal: Multiversion page api (inplace upgrade)
Zdenek.Kotala@[EMAIL PROT  2008-06-11 17:35:17 
Re: Proposal: Multiversion page api (inplace upgrade)
heikki@[EMAIL PROTECTED]   2008-06-11 17:59:06 
Re: Proposal: Multiversion page api (inplace upgrade)
tgl@[EMAIL PROTECTED] (T  2008-06-11 11:15:06 
Re: Proposal: Multiversion page api (inplace upgrade)
heikki@[EMAIL PROTECTED]   2008-06-11 18:42:57 
Re: Proposal: Multiversion page api (inplace upgrade)
rm_pg@[EMAIL PROTECTED]   2008-06-12 14:53:07 
Re: Proposal: Multiversion page api (inplace upgrade)
Zdenek.Kotala@[EMAIL PROT  2008-06-11 17:42:54 
Re: Proposal: Multiversion page api (inplace upgrade)
Zdenek.Kotala@[EMAIL PROT  2008-06-11 18:02:22 
Re: Proposal: Multiversion page api (inplace upgrade)
stark@[EMAIL PROTECTED]   2008-06-12 01:17:59 
Re: Proposal: Multiversion page api (inplace upgrade)
Stephen.Denne@[EMAIL PROT  2008-06-12 13:26:20 
Re: Proposal: Multiversion page api (inplace
bruce@[EMAIL PROTECTED]   2008-06-12 13:43:51 
Re: Proposal: Multiversion page api (inplace upgrade)
Zdenek.Kotala@[EMAIL PROT  2008-06-13 11:26:07 
Re: Proposal: Multiversion page api (inplace upgrade)
Zdenek.Kotala@[EMAIL PROT  2008-06-13 10:27:19 
Re: Proposal: Multiversion page api (inplace upgrade)
tgl@[EMAIL PROTECTED] (T  2008-06-13 12:18:37 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon Dec 1 14:04:50 CST 2008.