From 1120236dca4cf1ee6cec427fed952b033012278a Mon Sep 17 00:00:00 2001 From: Kaushik Iska Date: Sat, 30 Sep 2023 09:29:29 -0400 Subject: [PATCH] more fixes to handling logrepl messages See: https://github.com/jackc/pglogrepl/pull/59 --- flow/connectors/postgres/cdc.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/flow/connectors/postgres/cdc.go b/flow/connectors/postgres/cdc.go index 3be9406c3..48a94cd40 100644 --- a/flow/connectors/postgres/cdc.go +++ b/flow/connectors/postgres/cdc.go @@ -201,6 +201,9 @@ func (p *PostgresCDCSource) consumeStream( log.Debugf("Primary Keepalive Message => ServerWALEnd: %s ServerTime: %s ReplyRequested: %t", pkm.ServerWALEnd, pkm.ServerTime, pkm.ReplyRequested) + if pkm.ServerWALEnd > clientXLogPos { + clientXLogPos = pkm.ServerWALEnd + } if pkm.ReplyRequested { nextStandbyMessageDeadline = time.Time{} }