refactor(lcnode): [hybrid cloud] lc scanner skip trash dir #22797969

Signed-off-by: zhaochenyang <zhaochenyang@oppo.com>
This commit is contained in:
zhaochenyang 2024-11-15 17:16:21 +08:00 committed by Victor1319
parent 2c0400ffe5
commit 8092937450
2 changed files with 11 additions and 0 deletions

View File

@ -50,6 +50,7 @@ const (
maxLcNodeTaskCountLimit = 20
defaultDelayDelMinute = 1440 // default retention min(1 day) of old eks after migration
MaxSizePutOnce = int64(1) << 23 // 8MB
DirTrashSkip = ".Trash"
defaultAllocRetryInterval = 100
defaultWriteRetryInterval = 100

View File

@ -588,6 +588,11 @@ func expired(inode *proto.InodeInfo, now int64, days *int, date *time.Time) bool
func (s *LcScanner) handleDirLimitDepthFirst(dentry *proto.ScanDentry) {
log.LogInfof("handleDirLimitDepthFirst dentry: %+v, dirChan.Len: %v", dentry, s.dirChan.Len())
if dentry.Name == DirTrashSkip {
log.LogInfof("handleDirLimitDepthFirst skip read dir %+v", dentry)
return
}
marker := ""
done := false
for !done {
@ -661,6 +666,11 @@ func (s *LcScanner) handleDirLimitDepthFirst(dentry *proto.ScanDentry) {
func (s *LcScanner) handleDirLimitBreadthFirst(dentry *proto.ScanDentry) {
log.LogInfof("handleDirLimitBreadthFirst dentry: %+v, dirChan.Len: %v", dentry, s.dirChan.Len())
if dentry.Name == DirTrashSkip {
log.LogInfof("handleDirLimitBreadthFirst skip read dir %+v", dentry)
return
}
marker := ""
done := false
for !done {