[Patch] Space reservation (pgupgrade)

From: Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: [Patch] Space reservation (pgupgrade)
Date: 2008-12-12 11:43:48
Message-ID: 49424E74.2060605@sun.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I attached patch which add capability to reserve space on page for future
upgrade. It is mandatory for future in-place upgrade implementation. This patch
contains basic infrastructure not preupgrade script itself. I'm going to send
WIP preupgrade script today in separate mail.

This patch contains following modifications:

1) I added datpreupgstatus and relpreupgstatus attribute into pg_database and
pg_class. Original idea was to use only flag, but I need more info for tracking
several process status (like 0 - not set, 1 - reserved space set, 2 -
reservation is finished and so on).

I'm not sure if datpreupgstatus will be useful, but I think better is to have it
here.

2) I added two reloption rs_perpage and rs_pertuple for setup amount of reserved
space. I think these two attributes are enough for configure all case. Keep in
mind that for each relation could be these parameters different.

3) I adapted source code to respect new reloptions. Basic idea of it is that
before someone call PageAddItem it checks free space on a page
(PageGetFreeSpace...). I modify PageGetFreeSpace function to count reserved
space. Unfortunately, it requires additional parameters.

It works, but I'm not sure if any external enhancement cannot shortcut this and
call PageAddItem without PageFreeSpace call.

I'm thinking now about refactoring it and replace PageGetFreeSpace(Heap)
functions with RelPageGetFreeSpace and add new function RelPageAddItem.
RelPageAddItem will replace all direct call of PageAddItem.

Comments, ideas?

thanks Zdenek

Attachment Content-Type Size
spacereserve.patch text/x-diff 43.0 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2008-12-12 11:44:21 Re: benchmarking the query planner
Previous Message Simon Riggs 2008-12-12 11:35:07 Re: Sync Rep: First Thoughts on Code