Skip to content

Commit

Permalink
better CDC error logging
Browse files Browse the repository at this point in the history
  • Loading branch information
iskakaushik committed Feb 13, 2024
1 parent 9081af8 commit 93e0bd3
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions flow/connectors/postgres/cdc.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,17 +286,21 @@ func (p *PostgresCDCSource) consumeStream(
// if we are past the next standby deadline (?)
if time.Now().After(nextStandbyMessageDeadline) {
if !cdcRecordsStorage.IsEmpty() {
p.logger.Info(fmt.Sprintf("[%s] standby deadline reached, have %d records, will return at next commit",
p.logger.Info(fmt.Sprintf("[%s] standby deadline reached, have %d records",
p.flowJobName,
cdcRecordsStorage.Len()),
)

if !p.commitLock {
// immediate return if we are not waiting for a commit
p.logger.Info(
fmt.Sprintf("no commit lock, returning currently accumulated records - %d",
cdcRecordsStorage.Len()))
return nil
} else {
p.logger.Info(fmt.Sprintf("commit lock, waiting for commit to return records - %d",
cdcRecordsStorage.Len()))
waitingForCommit = true
}

waitingForCommit = true
} else {
p.logger.Info(fmt.Sprintf("[%s] standby deadline reached, no records accumulated, continuing to wait",
p.flowJobName),
Expand Down

0 comments on commit 93e0bd3

Please sign in to comment.