Skip to content

Commit

Permalink
Merge branch 'master' into server-cmd-cpu-profile
Browse files Browse the repository at this point in the history
  • Loading branch information
meiji163 committed Jan 31, 2024
2 parents dbe8c1f + a6cddf9 commit cbc6c57
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion go/logic/migrator.go
Original file line number Diff line number Diff line change
Expand Up @@ -1042,7 +1042,14 @@ func (this *Migrator) printStatus(rule PrintStatusRule, writers ...io.Writer) {
)
w := io.MultiWriter(writers...)
fmt.Fprintln(w, status)
this.migrationContext.Log.Infof(status)

// This "hack" is required here because the underlying logging library
// github.com/outbrain/golib/log provides two functions Info and Infof; but the arguments of
// both these functions are eventually redirected to the same function, which internally calls
// fmt.Sprintf. So, the argument of every function called on the DefaultLogger object
// migrationContext.Log will eventually pass through fmt.Sprintf, and thus the '%' character
// needs to be escaped.
this.migrationContext.Log.Info(strings.Replace(status, "%", "%%", 1))

hooksStatusIntervalSec := this.migrationContext.HooksStatusIntervalSec
if hooksStatusIntervalSec > 0 && elapsedSeconds%hooksStatusIntervalSec == 0 {
Expand Down
2 changes: 1 addition & 1 deletion go/logic/streamer.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ func (this *EventsStreamer) StreamEvents(canStopStreaming func() bool) error {
} else {
successiveFailures = 0
}
if successiveFailures > this.migrationContext.MaxRetries() {
if successiveFailures >= this.migrationContext.MaxRetries() {
return fmt.Errorf("%d successive failures in streamer reconnect at coordinates %+v", successiveFailures, this.GetReconnectBinlogCoordinates())
}

Expand Down

0 comments on commit cbc6c57

Please sign in to comment.