Skip to content
This repository has been archived by the owner on Nov 24, 2023. It is now read-only.

Commit

Permalink
wait to ensure old file not updated
Browse files Browse the repository at this point in the history
  • Loading branch information
GMHDBJD committed Jan 6, 2021
1 parent 2530587 commit 20f40cd
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/streamer/reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,12 @@ func (r *BinlogReader) parseFile(
case <-ctx.Done():
return false, false, 0, "", "", nil
case switchResp := <-switchCh:
// wait to ensure old file not updated
pathUpdated := utils.WaitSomething(3, watcherInterval, func() bool { return len(updatePathCh) > 0 })
if pathUpdated {
// re-parse it
return false, true, latestPos, "", "", nil
}
// update new uuid
if err = r.updateUUIDs(); err != nil {
return false, false, 0, "", "", nil
Expand Down

0 comments on commit 20f40cd

Please sign in to comment.