diff --git a/domain/domain.go b/domain/domain.go index 3e829c7511114..0d5aeb11ce813 100644 --- a/domain/domain.go +++ b/domain/domain.go @@ -421,7 +421,7 @@ func (do *Domain) topNSlowQueryLoop() { func (do *Domain) infoSyncerKeeper() { defer do.wg.Done() defer recoverInDomain("infoSyncerKeeper", false) - ticker := time.NewTicker(time.Second * time.Duration(infosync.InfoSessionTTL) / 2) + ticker := time.NewTicker(infosync.ReportInterval) defer ticker.Stop() for { select { diff --git a/domain/infosync/info.go b/domain/infosync/info.go index 244592f08dc91..e725ee16522ec 100644 --- a/domain/infosync/info.go +++ b/domain/infosync/info.go @@ -43,14 +43,15 @@ const ( // ServerMinStartTSPath store the server min start timestamp. ServerMinStartTSPath = "/tidb/server/minstartts" // keyOpDefaultRetryCnt is the default retry count for etcd store. - keyOpDefaultRetryCnt = 2 + keyOpDefaultRetryCnt = 5 // keyOpDefaultTimeout is the default time out for etcd store. keyOpDefaultTimeout = 1 * time.Second + // InfoSessionTTL is the ETCD session's TTL in seconds. + InfoSessionTTL = 10 * 60 + // ReportInterval is interval of infoSyncerKeeper reporting min startTS. + ReportInterval = 30 * time.Second ) -// InfoSessionTTL is the etcd session's TTL in seconds. It's exported for testing. -var InfoSessionTTL = 1 * 60 - // InfoSyncer stores server info to etcd when the tidb-server starts and delete when tidb-server shuts down. type InfoSyncer struct { etcdCli *clientv3.Client