Skip to content

Commit

Permalink
[cdc] Flush at the beginning of CDC until consumedXLogPos (#688)
Browse files Browse the repository at this point in the history
This was missed before, when `wal_sender_timeout` is set to a large
value waiting for PKMs is a bad idea
  • Loading branch information
iskakaushik authored Nov 21, 2023
1 parent b65913f commit c6ad0f6
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 c6ad0f6

Please sign in to comment.