diff --git a/dm/loader/loader.go b/dm/loader/loader.go index 36d8ea9ba8d..2b80fba6ac7 100644 --- a/dm/loader/loader.go +++ b/dm/loader/loader.go @@ -442,7 +442,7 @@ type Loader struct { dbTableDataTotalSize map[string]map[string]*atomic.Int64 dbTableDataFinishedSize map[string]map[string]*atomic.Int64 dbTableDataLastFinishedSize map[string]map[string]*atomic.Int64 - dbTableDataLastUpdatedTime time.Time + dbTableDataLastUpdatedTime atomic.Time metaBinlog atomic.String metaBinlogGTID atomic.String diff --git a/dm/loader/status.go b/dm/loader/status.go index 4c47e1fd738..33a619ea30f 100644 --- a/dm/loader/status.go +++ b/dm/loader/status.go @@ -44,7 +44,7 @@ func (l *Loader) printStatus() { totalSize := l.totalDataSize.Load() totalFileCount := l.totalFileCount.Load() - interval := time.Since(l.dbTableDataLastUpdatedTime) + interval := time.Since(l.dbTableDataLastUpdatedTime.Load()) intervalSecond := interval.Seconds() if intervalSecond == 0 { return @@ -62,7 +62,7 @@ func (l *Loader) printStatus() { } } } - l.dbTableDataLastUpdatedTime = time.Now() + l.dbTableDataLastUpdatedTime.Store(time.Now()) l.logger.Info("progress status of load", zap.Int64("finished_bytes", finishedSize),