]> granicus.if.org Git - postgresql/commit
Refactor per-page logic common to all redo routines to a new function.
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Wed, 13 Aug 2014 12:39:08 +0000 (15:39 +0300)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Tue, 2 Sep 2014 12:10:28 +0000 (15:10 +0300)
commitf8f4227976a2cdb8ac7c611e49da03aa9e65e0d2
tree92a7aa95ce72fbac48325761761821f8d7a742ed
parent26f8b99b248aae989e63ca0969a746f30b0c8c21
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.
src/backend/access/gin/ginxlog.c
src/backend/access/gist/gistxlog.c
src/backend/access/heap/heapam.c
src/backend/access/nbtree/nbtxlog.c
src/backend/access/spgist/spgxlog.c
src/backend/access/transam/README
src/backend/access/transam/xlogutils.c
src/include/access/xlogutils.h