diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2006-03-29 21:17:39 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2006-03-29 21:17:39 +0000 |
commit | 6d61cdec0761dc1f86a196899825b52b1186d00e (patch) | |
tree | 654a0eceb4b0b324ca05c292cb1877d6a45501ee /src/backend/commands/sequence.c | |
parent | 2154e1c11e4fbb6b41f6db1ea7c49e25f98d0df7 (diff) | |
download | postgresql-6d61cdec0761dc1f86a196899825b52b1186d00e.tar.gz postgresql-6d61cdec0761dc1f86a196899825b52b1186d00e.zip |
Clean up and document the API for XLogOpenRelation and XLogReadBuffer.
This commit doesn't make much functional change, but it does eliminate some
duplicated code --- for instance, PageIsNew tests are now done inside
XLogReadBuffer rather than by each caller.
The GIST xlog code still needs a lot of love, but I'll worry about that
separately.
Diffstat (limited to 'src/backend/commands/sequence.c')
-rw-r--r-- | src/backend/commands/sequence.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/backend/commands/sequence.c b/src/backend/commands/sequence.c index 144cf73c8a4..0e448271e13 100644 --- a/src/backend/commands/sequence.c +++ b/src/backend/commands/sequence.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/commands/sequence.c,v 1.130 2006/03/24 04:32:13 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/commands/sequence.c,v 1.131 2006/03/29 21:17:38 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -1140,14 +1140,8 @@ seq_redo(XLogRecPtr lsn, XLogRecord *record) elog(PANIC, "seq_redo: unknown op code %u", info); reln = XLogOpenRelation(xlrec->node); - if (!RelationIsValid(reln)) - return; - - buffer = XLogReadBuffer(true, reln, 0); - if (!BufferIsValid(buffer)) - elog(PANIC, "seq_redo: can't read block 0 of rel %u/%u/%u", - xlrec->node.spcNode, xlrec->node.dbNode, xlrec->node.relNode); - + buffer = XLogReadBuffer(reln, 0, true); + Assert(BufferIsValid(buffer)); page = (Page) BufferGetPage(buffer); /* Always reinit the page and reinstall the magic number */ |