mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-02 03:48:37 +08:00
Add default timestamp when send statistics of pchan (#5854)
Signed-off-by: dragondriver <jiquan.long@zilliz.com>
This commit is contained in:
parent
e70d359600
commit
2875b10dc5
@ -281,6 +281,12 @@ func (node *ProxyNode) sendChannelsTimeTickLoop() {
|
|||||||
case <-node.ctx.Done():
|
case <-node.ctx.Done():
|
||||||
return
|
return
|
||||||
case <-timer.C:
|
case <-timer.C:
|
||||||
|
ts, err := node.tsoAllocator.AllocOne()
|
||||||
|
if err != nil {
|
||||||
|
log.Warn("Failed to get timestamp from tso", zap.Error(err))
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
stats, err := node.chTicker.getMinTsStatistics()
|
stats, err := node.chTicker.getMinTsStatistics()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Warn("sendChannelsTimeTickLoop.getMinTsStatistics", zap.Error(err))
|
log.Warn("sendChannelsTimeTickLoop.getMinTsStatistics", zap.Error(err))
|
||||||
@ -290,10 +296,15 @@ func (node *ProxyNode) sendChannelsTimeTickLoop() {
|
|||||||
channels := make([]pChan, 0, len(stats))
|
channels := make([]pChan, 0, len(stats))
|
||||||
tss := make([]Timestamp, 0, len(stats))
|
tss := make([]Timestamp, 0, len(stats))
|
||||||
|
|
||||||
|
maxTs := ts
|
||||||
for channel, ts := range stats {
|
for channel, ts := range stats {
|
||||||
channels = append(channels, channel)
|
channels = append(channels, channel)
|
||||||
tss = append(tss, ts)
|
tss = append(tss, ts)
|
||||||
|
if ts > maxTs {
|
||||||
|
maxTs = ts
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Debug("send timestamp statistics of pchan", zap.Any("channels", channels), zap.Any("tss", tss))
|
log.Debug("send timestamp statistics of pchan", zap.Any("channels", channels), zap.Any("tss", tss))
|
||||||
|
|
||||||
req := &internalpb.ChannelTimeTickMsg{
|
req := &internalpb.ChannelTimeTickMsg{
|
||||||
@ -303,8 +314,9 @@ func (node *ProxyNode) sendChannelsTimeTickLoop() {
|
|||||||
Timestamp: 0, // todo
|
Timestamp: 0, // todo
|
||||||
SourceID: node.session.ServerID,
|
SourceID: node.session.ServerID,
|
||||||
},
|
},
|
||||||
ChannelNames: channels,
|
ChannelNames: channels,
|
||||||
Timestamps: tss,
|
Timestamps: tss,
|
||||||
|
DefaultTimestamp: maxTs,
|
||||||
}
|
}
|
||||||
|
|
||||||
status, err := node.masterService.UpdateChannelTimeTick(node.ctx, req)
|
status, err := node.masterService.UpdateChannelTimeTick(node.ctx, req)
|
||||||
|
Loading…
Reference in New Issue
Block a user