mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-09-04 23:07:20 +02:00
EndRecPtr is the last record that we've read, but not necessarily yet replayed. CheckRecoveryConsistency should compare minRecoveryPoint with the last replayed record instead. This caused recovery to think it's reached consistency too early. Now that we do the check in CheckRecoveryConsistency correctly, we have to move the call of that function to after redoing a record. The current place, after reading a record but before replaying it, is wrong. In particular, if there are no more records after the one ending at minRecoveryPoint, we don't enter hot standby until one extra record is generated and read by the standby, and CheckRecoveryConsistency is called. These two bugs conspired to make the code appear to work correctly, except for the small window between reading the last record that reaches minRecoveryPoint, and replaying it. In the passing, rename recoveryLastRecPtr, which is the last record replayed, to lastReplayedEndRecPtr. This makes it slightly less confusing with replayEndRecPtr, which is the last record read that we're about to replay. Original report from Kyotaro HORIGUCHI, further diagnosis by Fujii Masao. Backpatch to 9.0, where Hot Standby subtly changed the test from "minRecoveryPoint < EndRecPtr" to "minRecoveryPoint <= EndRecPtr". The former works because where the test is performed, we have always read one more record than we've replayed. |
||
---|---|---|
.. | ||
access | ||
bootstrap | ||
catalog | ||
commands | ||
executor | ||
foreign | ||
lib | ||
libpq | ||
main | ||
nodes | ||
optimizer | ||
parser | ||
po | ||
port | ||
postmaster | ||
regex | ||
replication | ||
rewrite | ||
snowball | ||
storage | ||
tcop | ||
tsearch | ||
utils | ||
.gitignore | ||
common.mk | ||
Makefile | ||
nls.mk |