Skip to content

Commit

Permalink
more logging, counting
Browse files Browse the repository at this point in the history
  • Loading branch information
serprex committed Feb 15, 2024
1 parent 3bc529b commit 44148af
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 3 additions & 1 deletion flow/connectors/postgres/cdc.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,12 @@ func (p *PostgresCDCSource) PullRecords(ctx context.Context, req *model.PullReco
pkmRequiresResponse := false
waitingForCommit := false

iii := 0
for {
iii++
_, err := p.getCurrentLSN(ctx)
if err != nil {
return fmt.Errorf("!!! current LSN: %w", err)
return fmt.Errorf("!!! current LSN %d: %w", iii, err)
}

if pkmRequiresResponse {
Expand Down
5 changes: 5 additions & 0 deletions flow/connectors/postgres/postgres.go
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,11 @@ func (c *PostgresConnector) PullRecords(ctx context.Context, catalogPool *pgxpoo
return err
}

_, err = c.getCurrentLSN(ctx)
if err != nil {
return fmt.Errorf("=== current LSN: %w", err)
}

cdc, err := c.NewPostgresCDCSource(&PostgresCDCConfig{
SrcTableIDNameMapping: req.SrcTableIDNameMapping,
Slot: slotName,
Expand Down

0 comments on commit 44148af

Please sign in to comment.