mirror of
https://github.com/postgres/postgres.git
synced 2025-11-10 17:42:29 +03:00
Fix corner-case bug in tracking of latest removed WAL segment during
streaming replication. We used log/seg 0/0 to indicate that no WAL segments have been removed since startup, but 0/0 is a valid value for the very first WAL segment after initdb. To make that disambiguous, store (latest removed WAL segment + 1) in the global variable. Per report from Matt Chesler, also reproduced by Greg Smith.
This commit is contained in:
@@ -654,7 +654,7 @@ XLogRead(char *buf, XLogRecPtr recptr, Size nbytes)
|
||||
XLogGetLastRemoved(&lastRemovedLog, &lastRemovedSeg);
|
||||
XLByteToSeg(startRecPtr, log, seg);
|
||||
if (log < lastRemovedLog ||
|
||||
(log == lastRemovedLog && seg <= lastRemovedSeg))
|
||||
(log == lastRemovedLog && seg < lastRemovedSeg))
|
||||
{
|
||||
char filename[MAXFNAMELEN];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user