From fe6e710877a6673d367c674e9b454fc06daccd40 Mon Sep 17 00:00:00 2001 From: Lynn Date: Thu, 9 Aug 2018 18:58:29 +0800 Subject: [PATCH] ddl: make check all versions norma (#7319) --- ddl/syncer.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ddl/syncer.go b/ddl/syncer.go index 7549604d25e35..9d4da63e2b26f 100644 --- a/ddl/syncer.go +++ b/ddl/syncer.go @@ -225,6 +225,8 @@ func (s *schemaVersionSyncer) UpdateSelfVersion(ctx context.Context, version int func (s *schemaVersionSyncer) OwnerUpdateGlobalVersion(ctx context.Context, version int64) error { startTime := time.Now() ver := strconv.FormatInt(version, 10) + // TODO: If the version is larger than the original global version, we need set the version. + // Otherwise, we'd better set the original global version. err := s.putKV(ctx, putKeyRetryUnlimited, DDLGlobalSchemaVersion, ver) metrics.OwnerHandleSyncerHistogram.WithLabelValues(metrics.OwnerUpdateGlobalVersion, metrics.RetLabel(err)).Observe(time.Since(startTime).Seconds()) @@ -337,7 +339,7 @@ func (s *schemaVersionSyncer) OwnerCheckAllVersions(ctx context.Context, latestV succ = false break } - if int64(ver) != latestVer { + if int64(ver) < latestVer { if notMatchVerCnt%intervalCnt == 0 { log.Infof("[syncer] check all versions, ddl %s is not synced, current ver %v, latest version %v, continue checking", kv.Key, ver, latestVer)