[#98] fstree: Do not fail iteration over just removed files #157

Merged
fyrchik merged 1 commit from carpawell/frostfs-node:fix/fstree-iteration-over-deleted-files into master 2023-03-22 07:26:28 +00:00
2 changed files with 7 additions and 3 deletions

View file

@ -50,6 +50,7 @@ Changelog for FrostFS Node
- Actually use `object.put.pool_size_local` and independent pool for local puts (#64).
- Pretty printer of basic ACL in the NeoFS CLI (#2259)
- Adding of public key for nns group `group.frostfs` at init step (#130)
- Iterating over just removed files by FSTree (#98)
### Removed
### Updated

View file

@ -135,13 +135,16 @@ func (t *FSTree) iterate(depth uint64, curPath []string, prm common.IteratePrm)
continue
}
data, err := os.ReadFile(filepath.Join(curPath...))
if err != nil && os.IsNotExist(err) {
continue
}
if prm.LazyHandler != nil {
err = prm.LazyHandler(addr, func() ([]byte, error) {
return os.ReadFile(filepath.Join(curPath...))
return data, err
})
} else {
var data []byte
data, err = os.ReadFile(filepath.Join(curPath...))
if err == nil {
data, err = t.Decompress(data)
}