Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ddl: fix version syncer doesn't print who hasn't synced on partial sync (#58511) #58754

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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