feat(flashnode): add error cacheBlock number count during restart loading process.

close:#23021760

Signed-off-by: shuqiang-zheng <zhengshuqiang@oppo.com>
This commit is contained in:
shuqiang-zheng 2025-02-17 17:23:50 +08:00 committed by zhumingze1108
parent 630b48ed2f
commit 815fb21cde

View File

@ -241,12 +241,13 @@ func unmarshalCacheBlockName(name string) (inode uint64, offset uint64, version
func (c *CacheEngine) LoadCacheBlock() (err error) {
var (
wg sync.WaitGroup
cbNum atomicutil.Int64
wg sync.WaitGroup
cbNum atomicutil.Int64
errorCbNum atomicutil.Int64
)
begin := time.Now()
defer func() {
msg := fmt.Sprintf("[LoadCacheBlock] load all cacheBlock(%v) using time(%v)", cbNum.Load(), time.Since(begin))
msg := fmt.Sprintf("[LoadCacheBlock] load all cacheBlock(%v) using time(%v), error cacheBlock num is (%v)", cbNum.Load(), time.Since(begin), errorCbNum.Load())
syslog.Print(msg)
log.LogInfo(msg)
}()
@ -289,6 +290,7 @@ func (c *CacheEngine) LoadCacheBlock() (err error) {
c.deleteCacheBlock(GenCacheBlockKey(volume, inode, offset, version))
log.LogInfof("action[LoadCacheBlock] createCacheBlock(%v) from dataPath(%v) volume(%v) err(%v) ",
filename, fullPath, volume, err.Error())
errorCbNum.Add(1)
continue
}
cbNum.Add(1)