Skip to content

Commit

Permalink
ddl: Add interval to log (pingcap#3422)
Browse files Browse the repository at this point in the history
  • Loading branch information
zimulala authored and shenli committed Jun 8, 2017
1 parent 72981fd commit b8972bc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion ddl/syncer.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ func isContextFinished(err error) bool {
// OwnerCheckAllVersions implements SchemaSyncer.OwnerCheckAllVersions interface.
func (s *schemaVersionSyncer) OwnerCheckAllVersions(ctx goctx.Context, latestVer int64) error {
time.Sleep(CheckVersFirstWaitTime)
notMatchVerCnt := 0
intervalCnt := int(time.Second / checkVersInterval)
updatedMap := make(map[string]struct{})
for {
select {
Expand Down Expand Up @@ -188,8 +190,12 @@ func (s *schemaVersionSyncer) OwnerCheckAllVersions(ctx goctx.Context, latestVer
break
}
if int64(ver) != latestVer {
log.Infof("[syncer] check all versions, ddl %s current ver %v, latest version %v", kv.Key, ver, latestVer)
if notMatchVerCnt%intervalCnt == 0 {
log.Infof("[syncer] check all versions, ddl %s current ver %v, latest version %v",
kv.Key, ver, latestVer)
}
succ = false
notMatchVerCnt++
break
}
updatedMap[string(kv.Key)] = struct{}{}
Expand Down
2 changes: 1 addition & 1 deletion tidb.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func (dm *domainMap) Get(store kv.Storage) (d *domain.Domain, err error) {
statisticLease = statsLease
}
err = util.RunWithRetry(defaultMaxRetries, retryInterval, func() (retry bool, err1 error) {
log.Infof("store %v new domain, ddl lease %v, stats lease", store.UUID(), ddlLease, statisticLease)
log.Infof("store %v new domain, ddl lease %v, stats lease %d", store.UUID(), ddlLease, statisticLease)
factory := createSessionFunc(store)
d, err1 = domain.NewDomain(store, ddlLease, statisticLease, factory)
return true, errors.Trace(err1)
Expand Down

0 comments on commit b8972bc

Please sign in to comment.