mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-11 09:46:26 +08:00
Make timeTickInterval of Proxy configurable (#14515)
Signed-off-by: dragondriver <jiquan.long@zilliz.com>
This commit is contained in:
parent
9d0bc136e0
commit
c0b7f52036
@ -111,7 +111,7 @@ func (ticker *channelsTimeTickerImpl) tick() error {
|
||||
} else {
|
||||
if stat.minTs > current {
|
||||
ticker.minTsStatistics[pchan] = stat.minTs - 1
|
||||
next := now + Timestamp(sendTimeTickMsgInterval)
|
||||
next := now + Timestamp(Params.ProxyCfg.TimeTickInterval)
|
||||
if next > stat.maxTs {
|
||||
next = stat.maxTs
|
||||
}
|
||||
|
@ -48,8 +48,8 @@ type UniqueID = typeutil.UniqueID
|
||||
// Timestamp is alias of typeutil.Timestamp
|
||||
type Timestamp = typeutil.Timestamp
|
||||
|
||||
const sendTimeTickMsgInterval = 200 * time.Millisecond
|
||||
const channelMgrTickerInterval = 100 * time.Millisecond
|
||||
// const sendTimeTickMsgInterval = 200 * time.Millisecond
|
||||
// const channelMgrTickerInterval = 100 * time.Millisecond
|
||||
|
||||
// make sure Proxy implements types.Proxy
|
||||
var _ types.Proxy = (*Proxy)(nil)
|
||||
@ -238,8 +238,10 @@ func (node *Proxy) Init() error {
|
||||
}
|
||||
log.Debug("create task scheduler done", zap.String("role", typeutil.ProxyRole))
|
||||
|
||||
log.Debug("create channels time ticker", zap.String("role", typeutil.ProxyRole))
|
||||
node.chTicker = newChannelsTimeTicker(node.ctx, channelMgrTickerInterval, []string{}, node.sched.getPChanStatistics, tsoAllocator)
|
||||
syncTimeTickInterval := Params.ProxyCfg.TimeTickInterval / 2
|
||||
log.Debug("create channels time ticker",
|
||||
zap.String("role", typeutil.ProxyRole), zap.Duration("syncTimeTickInterval", syncTimeTickInterval))
|
||||
node.chTicker = newChannelsTimeTicker(node.ctx, Params.ProxyCfg.TimeTickInterval/2, []string{}, node.sched.getPChanStatistics, tsoAllocator)
|
||||
log.Debug("create channels time ticker done", zap.String("role", typeutil.ProxyRole))
|
||||
|
||||
log.Debug("create metrics cache manager", zap.String("role", typeutil.ProxyRole))
|
||||
@ -262,12 +264,12 @@ func (node *Proxy) sendChannelsTimeTickLoop() {
|
||||
go func() {
|
||||
defer node.wg.Done()
|
||||
|
||||
// TODO(dragondriver): read this from config
|
||||
timer := time.NewTicker(sendTimeTickMsgInterval)
|
||||
timer := time.NewTicker(Params.ProxyCfg.TimeTickInterval)
|
||||
|
||||
for {
|
||||
select {
|
||||
case <-node.ctx.Done():
|
||||
log.Info("send channels time tick loop exit")
|
||||
return
|
||||
case <-timer.C:
|
||||
stats, ts, err := node.chTicker.getMinTsStatistics()
|
||||
|
Loading…
Reference in New Issue
Block a user