From 3f0e808c4a487b1c12546acd80e6140d5093227b Mon Sep 17 00:00:00 2001 From: Heikki Linnakangas Date: Mon, 11 Aug 2008 11:05:11 +0000 Subject: Introduce the concept of relation forks. An smgr relation can now consist of multiple forks, and each fork can be created and grown separately. The bulk of this patch is about changing the smgr API to include an extra ForkNumber argument in every smgr function. Also, smgrscheduleunlink and smgrdounlink no longer implicitly call smgrclose, because other forks might still exist after unlinking one. The callers of those functions have been modified to call smgrclose instead. This patch in itself doesn't have any user-visible effect, but provides the infrastructure needed for upcoming patches. The additional forks envisioned are a rewritten FSM implementation that doesn't rely on a fixed-size shared memory block, and a visibility map to allow skipping portions of a table in VACUUM that have no dead tuples. --- src/backend/access/transam/xlog.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/backend/access/transam/xlog.c') diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index 72e531d3dc3..709836f2be7 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.316 2008/07/13 20:45:47 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.317 2008/08/11 11:05:10 heikki Exp $ * *------------------------------------------------------------------------- */ @@ -1034,8 +1034,7 @@ XLogCheckBuffer(XLogRecData *rdata, bool doPageWrites, /* * The page needs to be backed up, so set up *bkpb */ - bkpb->node = BufferGetFileNode(rdata->buffer); - bkpb->block = BufferGetBlockNumber(rdata->buffer); + BufferGetTag(rdata->buffer, &bkpb->node, &bkpb->fork, &bkpb->block); if (rdata->buffer_std) { @@ -2855,7 +2854,8 @@ RestoreBkpBlocks(XLogRecord *record, XLogRecPtr lsn) memcpy(&bkpb, blk, sizeof(BkpBlock)); blk += sizeof(BkpBlock); - buffer = XLogReadBuffer(bkpb.node, bkpb.block, true); + buffer = XLogReadBufferWithFork(bkpb.node, bkpb.fork, bkpb.block, + true); Assert(BufferIsValid(buffer)); page = (Page) BufferGetPage(buffer); -- cgit v1.2.3