fix: panic in timetick_sender (#35451)

https://github.com/milvus-io/milvus/issues/35450

Signed-off-by: fengjun2016 <jornfeng@gmail.com>
This commit is contained in:
CharlesFeng 2024-08-14 10:10:53 +08:00 committed by GitHub
parent 6f3fcdc810
commit a690e6e004
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -164,9 +164,10 @@ func (m *TimeTickSender) cleanStatesCache(lastSentTss map[string]uint64) {
delete(m.statsCache[channelName].segStats, segmentID)
}
}
}
if len(m.statsCache[channelName].segStats) == 0 {
delete(m.statsCache, channelName)
if len(m.statsCache[channelName].segStats) == 0 {
delete(m.statsCache, channelName)
}
}
}
log.RatedDebug(30, "TimeTickSender stats", zap.Any("lastSentTss", lastSentTss), zap.Int("sizeBeforeClean", sizeBeforeClean), zap.Int("sizeAfterClean", len(m.statsCache)))