Skip to content

Commit

Permalink
[cdc] Flush at the beginning of CDC until consumedXLogPos
Browse files Browse the repository at this point in the history
  • Loading branch information
iskakaushik committed Nov 20, 2023
1 parent 2a60ff3 commit a37bec5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions flow/connectors/postgres/cdc.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,12 @@ func (p *PostgresCDCSource) consumeStream(
consumedXLogPos := pglogrepl.LSN(0)
if clientXLogPos > 0 {
consumedXLogPos = clientXLogPos - 1

err := pglogrepl.SendStandbyStatusUpdate(p.ctx, conn,
pglogrepl.StandbyStatusUpdate{WALWritePosition: consumedXLogPos})
if err != nil {
return fmt.Errorf("[initial-flush] SendStandbyStatusUpdate failed: %w", err)
}
}

var standByLastLogged time.Time
Expand Down

0 comments on commit a37bec5

Please sign in to comment.