Skip to content

Commit

Permalink
ddl: fix version syncer doesn't print who hasn't synced on partial sy…
Browse files Browse the repository at this point in the history
…nc (#58511)

close #58480
  • Loading branch information
D3Hunter authored Dec 25, 2024
1 parent 1fef963 commit 623191c
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions pkg/ddl/schemaver/syncer.go
Original file line number Diff line number Diff line change
Expand Up @@ -370,15 +370,15 @@ func (s *etcdSyncer) WaitVersionSynced(ctx context.Context, jobID int64, latestV
// Check all schema versions.
if variable.EnableMDL.Load() {
notifyCh := make(chan struct{})
var unmatchedNodeID atomic.Pointer[string]
var unmatchedNodeInfo atomic.Pointer[string]
matchFn := func(nodeVersions map[string]int64) bool {
if len(nodeVersions) < len(updatedMap) {
if len(nodeVersions) == 0 {
return false
}
for tidbID := range updatedMap {
for tidbID, info := range updatedMap {
if nodeVer, ok := nodeVersions[tidbID]; !ok || nodeVer < latestVer {
id := tidbID
unmatchedNodeID.Store(&id)
linfo := info
unmatchedNodeInfo.Store(&linfo)
return false
}
}
Expand All @@ -394,9 +394,9 @@ func (s *etcdSyncer) WaitVersionSynced(ctx context.Context, jobID int64, latestV
return errors.Trace(ctx.Err())
case <-time.After(time.Second):
item.clearMatchFn()
if id := unmatchedNodeID.Load(); id != nil {
if info := unmatchedNodeInfo.Load(); info != nil {
logutil.DDLLogger().Info("syncer check all versions, someone is not synced",
zap.String("info", *id),
zap.String("info", *info),
zap.Int64("ddl job id", jobID),
zap.Int64("ver", latestVer))
} else {
Expand Down

0 comments on commit 623191c

Please sign in to comment.