Skip to content

Commit

Permalink
Fix clientXLogPos handling in pglogrepl_demo
Browse files Browse the repository at this point in the history
  • Loading branch information
espadolini authored and jackc committed Aug 26, 2023
1 parent d0818e1 commit 9ed16cb
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions example/pglogrepl_demo/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,9 @@ func main() {
log.Fatalln("ParsePrimaryKeepaliveMessage failed:", err)
}
log.Println("Primary Keepalive Message =>", "ServerWALEnd:", pkm.ServerWALEnd, "ServerTime:", pkm.ServerTime, "ReplyRequested:", pkm.ReplyRequested)

if pkm.ServerWALEnd > clientXLogPos {
clientXLogPos = pkm.ServerWALEnd
}
if pkm.ReplyRequested {
nextStandbyMessageDeadline = time.Time{}
}
Expand All @@ -147,7 +149,9 @@ func main() {
}
}

clientXLogPos = xld.WALStart + pglogrepl.LSN(len(xld.WALData))
if xld.WALStart > clientXLogPos {
clientXLogPos = xld.WALStart
}
}
}
}
Expand Down

0 comments on commit 9ed16cb

Please sign in to comment.