Skip to content

Commit

Permalink
ddl: make check all versions norma (#7319)
Browse files Browse the repository at this point in the history
  • Loading branch information
zimulala authored and coocood committed Aug 9, 2018
1 parent 702a116 commit fe6e710
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ddl/syncer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit fe6e710

Please sign in to comment.