Skip to content

Commit

Permalink
Merge pull request #349 from cashapp/mtocker-extend-timeout-in-flush
Browse files Browse the repository at this point in the history
repl: Improve Flush() to handle BlockWait() timeouts
  • Loading branch information
kolbe authored Sep 27, 2024
2 parents fd5b349 + 6006ca8 commit 77598d0
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pkg/repl/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -641,9 +641,14 @@ func (c *Client) Flush(ctx context.Context) error {
return err
}
// Wait for canal to catch up before determining if the changeset
// length is considered trivial.
// length is considered trivial. If it can't catch up before the
// timeout is reached (default 10s), it will return an error.
// In which case we are fine to just continue, which will start
// the loop again. After we flush what new changes we discovered here,
// we can try BlockWaiting again.
if err := c.BlockWait(ctx); err != nil {
return err
c.logger.Warnf("error waiting for canal to catch up: %v", err)
continue
}
if c.GetDeltaLen() < binlogTrivialThreshold {
break
Expand Down

0 comments on commit 77598d0

Please sign in to comment.