diff options
author | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2008-10-31 15:05:00 +0000 |
---|---|---|
committer | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2008-10-31 15:05:00 +0000 |
commit | 19c8dc839b64a43958f08108b85ce8ca98d06a8b (patch) | |
tree | be6bff739a33bd11e4915f47f30038840d397cd5 /src/backend/access/heap/heapam.c | |
parent | 29077051deae30b7704a3e3f2cf7d0a7e3a4130a (diff) | |
download | postgresql-19c8dc839b64a43958f08108b85ce8ca98d06a8b.tar.gz postgresql-19c8dc839b64a43958f08108b85ce8ca98d06a8b.zip |
Unite ReadBufferWithFork, ReadBufferWithStrategy, and ZeroOrReadBuffer
functions into one ReadBufferExtended function, that takes the strategy
and mode as argument. There's three modes, RBM_NORMAL which is the default
used by plain ReadBuffer(), RBM_ZERO, which replaces ZeroOrReadBuffer, and
a new mode RBM_ZERO_ON_ERROR, which allows callers to read corrupt pages
without throwing an error. The FSM needs the new mode to recover from
corrupt pages, which could happend if we crash after extending an FSM file,
and the new page is "torn".
Add fork number to some error messages in bufmgr.c, that still lacked it.
Diffstat (limited to 'src/backend/access/heap/heapam.c')
-rw-r--r-- | src/backend/access/heap/heapam.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/backend/access/heap/heapam.c b/src/backend/access/heap/heapam.c index ae21c3613e3..8b0c826aaf2 100644 --- a/src/backend/access/heap/heapam.c +++ b/src/backend/access/heap/heapam.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/access/heap/heapam.c,v 1.266 2008/10/27 21:50:12 alvherre Exp $ + * $PostgreSQL: pgsql/src/backend/access/heap/heapam.c,v 1.267 2008/10/31 15:04:59 heikki Exp $ * * * INTERFACE ROUTINES @@ -205,9 +205,8 @@ heapgetpage(HeapScanDesc scan, BlockNumber page) } /* read page using selected strategy */ - scan->rs_cbuf = ReadBufferWithStrategy(scan->rs_rd, - page, - scan->rs_strategy); + scan->rs_cbuf = ReadBufferExtended(scan->rs_rd, MAIN_FORKNUM, page, + RBM_NORMAL, scan->rs_strategy); scan->rs_cblock = page; if (!scan->rs_pageatatime) |