Attached is an updated version of my patch to refactor the
XLogOpenRelation/XLogReadBuffer interface, in preparation for the
relation forks patch, and subsequently the FSM rewrite patch.
I'm satisfied enough with it that I plan to commit it in a few days,
Summary of changes:
- XLogOpenRelation is gone. XLogReadBuffer now takes a RelFileNode as
argument, instead of Relation. Fix all callers.
- For the routines that need a fake, or lightweight, Relation struct
anyway, there's a new function called
XLogFakeRelcacheEntry(RelFileNode), that returns a palloc'd Relation struct.
- Add ReadBufferWithoutRelcache variant of ReadBuffer, that takes
RelFileNode instead of Relation as argument. This is what XLogReadBuffer
The only user-visible changes are these error message changes:
1. "invalid page header in block %u of relation %s" and "unexpected data
beyond EOF in block %u of relation \"%s\" messages, emitted from
ReadBuffer, no longer print the relation name, but only its relfilenode.
(This is because relation name is no longer conveniently available where
that message is emitted. It could be passed there if necessary, but it
doesn't seem worth the extra complexity)
2. elog("failed to additem to index page in \"%s\""), in gistutil.c. For
similar reasons, no longer prints the relation name. Unfortunately,
gistfillbuffer() doesn't know the relfilenode either. Again we could
pass it, but it doesn't seem worth the extra complexity, given that this
is just a "should never happen" elog, and the user should usually know
which index is at fault from the context information.
pgsql-patches by date
|Next:||From: Tom Lane||Date: 2008-06-10 15:02:45|
|Subject: Re: \timing on/off |
|Previous:||From: Alvaro Herrera||Date: 2008-06-10 14:22:47|
|Subject: Re: Tentative patch for making DROP put dependency infoin DETAIL|