Skip to content

Commit fe0bc60

Browse files
authored
ddl: fix version syncer doesn't print who hasn't synced on partial sync (#58511) (#58754)
close #58480
1 parent 5f4b16d commit fe0bc60

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

pkg/ddl/schemaver/syncer.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -370,15 +370,15 @@ func (s *etcdSyncer) WaitVersionSynced(ctx context.Context, jobID int64, latestV
370370
// Check all schema versions.
371371
if variable.EnableMDL.Load() {
372372
notifyCh := make(chan struct{})
373-
var unmatchedNodeID atomic.Pointer[string]
373+
var unmatchedNodeInfo atomic.Pointer[string]
374374
matchFn := func(nodeVersions map[string]int64) bool {
375-
if len(nodeVersions) < len(updatedMap) {
375+
if len(nodeVersions) == 0 {
376376
return false
377377
}
378-
for tidbID := range updatedMap {
378+
for tidbID, info := range updatedMap {
379379
if nodeVer, ok := nodeVersions[tidbID]; !ok || nodeVer < latestVer {
380-
id := tidbID
381-
unmatchedNodeID.Store(&id)
380+
linfo := info
381+
unmatchedNodeInfo.Store(&linfo)
382382
return false
383383
}
384384
}
@@ -394,9 +394,9 @@ func (s *etcdSyncer) WaitVersionSynced(ctx context.Context, jobID int64, latestV
394394
return errors.Trace(ctx.Err())
395395
case <-time.After(time.Second):
396396
item.clearMatchFn()
397-
if id := unmatchedNodeID.Load(); id != nil {
397+
if info := unmatchedNodeInfo.Load(); info != nil {
398398
logutil.DDLLogger().Info("syncer check all versions, someone is not synced",
399-
zap.String("info", *id),
399+
zap.String("info", *info),
400400
zap.Int64("ddl job id", jobID),
401401
zap.Int64("ver", latestVer))
402402
} else {

0 commit comments

Comments
 (0)