Refactor per-page logic common to all redo routines to a new function.
Every redo routine uses the same idiom to determine what to do to a page:
check if there's a backup block for it, and if not read, the buffer if the
block exists, and check its LSN. Refactor that into a common function,
XLogReadBufferForRedo, making all the redo routines shorter and more
readable.
This has no user-visible effect, and makes no changes to the WAL format.
Reviewed by Andres Freund, Alvaro Herrera, Michael Paquier.
Branch
------
master
Details
-------
http://git.postgresql.org/pg/commitdiff/f8f4227976a2cdb8ac7c611e49da03aa9e65e0d2
Modified Files
--------------
src/backend/access/gin/ginxlog.c | 234 +++----
src/backend/access/gist/gistxlog.c | 179 +++---
src/backend/access/heap/heapam.c | 1060 ++++++++++++++------------------
src/backend/access/nbtree/nbtxlog.c | 477 ++++++--------
src/backend/access/spgist/spgxlog.c | 883 ++++++++++++--------------
src/backend/access/transam/README | 66 +-
src/backend/access/transam/xlogutils.c | 81 +++
src/include/access/xlogutils.h | 23 +-
8 files changed, 1347 insertions(+), 1656 deletions(-)