]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Fix lastReplayedEndRecPtr calculation when starting from shutdown checkpoint.
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Wed, 5 Mar 2014 11:27:18 +0000 (13:27 +0200)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Wed, 5 Mar 2014 11:58:22 +0000 (13:58 +0200)
commit4521cc85075ca98b7337ae524c3e88ce723e61e9
tree1e2708b3e45f15925fc3fc8672f6bedb01a59118
parent43af0e8c6c1a455d038730f3ec33a5f23a560fe2
Fix lastReplayedEndRecPtr calculation when starting from shutdown checkpoint.

When entering crash recovery followed by archive recovery, and the latest
checkpoint is a shutdown checkpoint, and there are no more WAL records to
replay before transitioning from crash to archive recovery, we would not
immediately allow read-only connections in hot standby mode even if we
could. That's because when starting from a shutdown checkpoint, we set
lastReplayedEndRecPtr incorrectly to the record before the checkpoint
record, instead of the checkpoint record itself. We don't run the redo
routine of the shutdown checkpoint record, but starting recovery from it
goes through the same motions, so it should be considered as replayed.

Reported by Kyotaro HORIGUCHI. All versions with hot standby are affected,
so backpatch to 9.0.
src/backend/access/transam/xlog.c