@@ -370,15 +370,15 @@ func (s *etcdSyncer) WaitVersionSynced(ctx context.Context, jobID int64, latestV
370
370
// Check all schema versions.
371
371
if variable .EnableMDL .Load () {
372
372
notifyCh := make (chan struct {})
373
- var unmatchedNodeID atomic.Pointer [string ]
373
+ var unmatchedNodeInfo atomic.Pointer [string ]
374
374
matchFn := func (nodeVersions map [string ]int64 ) bool {
375
- if len (nodeVersions ) < len ( updatedMap ) {
375
+ if len (nodeVersions ) == 0 {
376
376
return false
377
377
}
378
- for tidbID := range updatedMap {
378
+ for tidbID , info := range updatedMap {
379
379
if nodeVer , ok := nodeVersions [tidbID ]; ! ok || nodeVer < latestVer {
380
- id := tidbID
381
- unmatchedNodeID .Store (& id )
380
+ linfo := info
381
+ unmatchedNodeInfo .Store (& linfo )
382
382
return false
383
383
}
384
384
}
@@ -394,9 +394,9 @@ func (s *etcdSyncer) WaitVersionSynced(ctx context.Context, jobID int64, latestV
394
394
return errors .Trace (ctx .Err ())
395
395
case <- time .After (time .Second ):
396
396
item .clearMatchFn ()
397
- if id := unmatchedNodeID .Load (); id != nil {
397
+ if info := unmatchedNodeInfo .Load (); info != nil {
398
398
logutil .DDLLogger ().Info ("syncer check all versions, someone is not synced" ,
399
- zap .String ("info" , * id ),
399
+ zap .String ("info" , * info ),
400
400
zap .Int64 ("ddl job id" , jobID ),
401
401
zap .Int64 ("ver" , latestVer ))
402
402
} else {
0 commit comments