Skip to content

Commit

Permalink
fix: 修复未正确解析备份语句时的状态标计
Browse files Browse the repository at this point in the history
  • Loading branch information
hanchuanchuan committed Dec 19, 2020
1 parent 2b3f6e9 commit fee2597
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions session/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ func (s *session) parserBinlog(ctx context.Context) {
}

// log.Errorf("binlog pos: %d", int(currentPosition.Pos))
// log.Errorf("binlog pos: %v", e.Header.EventType.String())
// log.Errorf("binlog type: %#v,%#v", e.Header.EventType, e.Header.EventType.String())
// log.Errorf("currentThreadID: %v", currentThreadID)
// e.Dump(os.Stdout)
// os.Stdout.Sync()
Expand Down Expand Up @@ -389,11 +389,14 @@ func (s *session) parserBinlog(ctx context.Context) {
// if (record.StageStatus == StatusExecFail && record.AffectedRows > 0) ||
// record.StageStatus == StatusExecOK || record.StageStatus == StatusBackupFail {
if record.AffectedRows > 0 {
record.StageStatus = StatusBackupOK
if changeRows >= record.AffectedRows {
record.StageStatus = StatusBackupOK
}
}

record.BackupCostTime = fmt.Sprintf("%.3f", time.Since(startTime).Seconds())

changeRows = 0
next := s.getNextBackupRecord()
if next != nil {
startPosition = mysql.Position{Name: next.StartFile,
Expand Down

0 comments on commit fee2597

Please sign in to comment.