Make datanode tt interval configurable (#22990)

Signed-off-by: xiaofan-luan <xiaofan.luan@zilliz.com>
pull/23007/head
Xiaofan 2023-03-25 15:00:00 +08:00 committed by GitHub
parent 51c414c0c0
commit 053acd39ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 2 deletions

View File

@ -72,13 +72,13 @@ func (mt *mergedTimeTickerSender) bufferTs(ts Timestamp, segmentIDs []int64) {
func (mt *mergedTimeTickerSender) tick() {
defer mt.wg.Done()
// this duration might be configuable in the future
t := time.NewTicker(time.Millisecond * 100) // 100 millisecond, 1/2 of rootcoord timetick duration
t := time.NewTicker(time.Duration(Params.DataNodeCfg.DataNodeTimeTickInterval) * time.Millisecond) // 500 millisecond
defer t.Stop()
for {
select {
case <-t.C:
mt.cond.L.Lock()
mt.cond.Signal() // allow worker to check every 0.1s
mt.cond.Signal()
mt.cond.L.Unlock()
case <-mt.closeCh:
return

View File

@ -1564,6 +1564,9 @@ type dataNodeConfig struct {
// io concurrency to fetch stats logs
IOConcurrency int
// datanote send timetick interval per channel
DataNodeTimeTickInterval int
CreatedTime time.Time
UpdatedTime time.Time
@ -1584,6 +1587,7 @@ func (p *dataNodeConfig) init(base *BaseTable) {
p.initBinlogMaxSize()
p.initSyncPeriod()
p.initIOConcurrency()
p.initDataNodeTimeTickInterval()
p.initChannelWatchPath()
p.initMemoryForceSyncEnable()
@ -1645,6 +1649,10 @@ func (p *dataNodeConfig) initIOConcurrency() {
p.IOConcurrency = p.Base.ParseIntWithDefault("dataNode.dataSync.ioConcurrency", 10)
}
func (p *dataNodeConfig) initDataNodeTimeTickInterval() {
p.DataNodeTimeTickInterval = p.Base.ParseIntWithDefault("datanode.timetick.interval", 500)
}
func (p *dataNodeConfig) SetNodeID(id UniqueID) {
p.NodeID.Store(id)
}