Skip to content

Commit

Permalink
domain: increase TTL to reduce the occurrence of reporting min startT…
Browse files Browse the repository at this point in the history
…S errors (#12578)
  • Loading branch information
jackysp authored and sre-bot committed Oct 23, 2019
1 parent bc997d7 commit 46968ad
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion domain/domain.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
9 changes: 5 additions & 4 deletions domain/infosync/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 46968ad

Please sign in to comment.