[skip ci] Fix bug: concurrent map read and map write (#5713)

Signed-off-by: zhenshan.cao <zhenshan.cao@zilliz.com>
pull/5779/head
zhenshan.cao 2021-06-10 14:57:55 +08:00
parent f2e551e9a0
commit 6ec2074da4
1 changed files with 6 additions and 1 deletions

View File

@ -57,7 +57,12 @@ func (ticker *channelsTimeTickerImpl) getMinTsStatistics() (map[pChan]Timestamp,
ticker.statisticsMtx.RLock()
defer ticker.statisticsMtx.RUnlock()
return ticker.minTsStatistics, nil
ret := make(map[pChan]Timestamp)
for k, v := range ticker.minTsStatistics {
ret[k] = v
}
return ret, nil
}
func (ticker *channelsTimeTickerImpl) initStatistics() {