summaryrefslogtreecommitdiff
path: root/src/backend/replication/walsender.c
diff options
context:
space:
mode:
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>2010-11-01 09:56:45 +0200
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>2010-11-01 10:04:45 +0200
commit268fecc62cde08c89952c26cb01db8f04a2dc88d (patch)
treef88b1caa5473a447600ffe3a0dbfffbbd82e8d4b /src/backend/replication/walsender.c
parent381d6a05aecbade0bf536325ace36f1507da042b (diff)
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.
Diffstat (limited to 'src/backend/replication/walsender.c')
-rw-r--r--src/backend/replication/walsender.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/replication/walsender.c b/src/backend/replication/walsender.c
index 2a16888b0ff..f3775ac72da 100644
--- a/src/backend/replication/walsender.c
+++ b/src/backend/replication/walsender.c
@@ -630,7 +630,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];