[skip ci]Update comment of cache in datanode (#9313)

Signed-off-by: Yang Xuan <xuan.yang@zilliz.com>
This commit is contained in:
XuanYang-cn 2021-10-06 07:08:24 +08:00 committed by GitHub
parent 270cdbd4e2
commit e7aa5eebd6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,10 +5,14 @@ import (
)
// Cache stores flusing segments' ids to prevent flushing the same segment again and again.
// Once the segment is flushed, its id will be removed from the cache.
// Once a segment is flushed, its id will be removed from the cache.
//
// A segment not in cache will be added into the cache when `FlushSegments` is called.
// After the flush procedure, wether the segment successfully flushed or not,
// it'll be removed from the cache. So if flush failed, the secondary flush can be triggered.
type Cache struct {
cacheMu sync.RWMutex
cacheMap map[UniqueID]bool
cacheMap map[UniqueID]bool // TODO GOOSE: change into sync.map
}
func newCache() *Cache {