Skip to content

Commit 8463880

Browse files
Fix LagTrackerRead() for timeline increments
Bug was masked by error in running 004_timeline_switch.pl that was fixed recently in 7d68f22. Detective work by Alvaro Herrera and Tom Lane Author: Thomas Munro
1 parent 0874d4f commit 8463880

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/backend/replication/walsender.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3328,7 +3328,16 @@ LagTrackerRead(int head, XLogRecPtr lsn, TimestampTz now)
33283328
WalTimeSample prev = LagTracker.last_read[head];
33293329
WalTimeSample next = LagTracker.buffer[LagTracker.read_heads[head]];
33303330

3331-
Assert(lsn >= prev.lsn);
3331+
if (lsn < prev.lsn)
3332+
{
3333+
/*
3334+
* Reported LSNs shouldn't normally go backwards, but it's
3335+
* possible when there is a timeline change. Treat as not
3336+
* found.
3337+
*/
3338+
return -1;
3339+
}
3340+
33323341
Assert(prev.lsn < next.lsn);
33333342

33343343
if (prev.time > next.time)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy