noobaa-core
noobaa-core copied to clipboard
NSFS unneeded read calls to warmup sparse file
Environment info
- NooBaa Version: 5.15
- Platform: RHEL
Actual behavior
- Our check for using "warmup sparse file" flow in NamespaceFS.read_object_stream() checks on the constant stat that was taken outside the loop, so after initial warmup worked as expected and prefetched the file, we keep checking with the original stat and will keep sending unneeded warmup calls. See:
https://github.com/noobaa/noobaa-core/blob/176c6f6b0f7d2ab748505612e685474d252eb85c/src/sdk/namespace_fs.js#L987-L999
Expected behavior
- We should refresh the stat - probably enough to update just once after the first warmup, assuming that the likelyhood of a file to become sparse again (evicted from cache, or migrated to tape) is low.
- Other option is to always check stat before each read, which seems wasteful too.
Steps to reproduce
- Read a large sparse file using NSFS that becomes non-sparse on read (transparent recall / fetch).
- See how every loop we keep on logging the "warmup sparse file" message and sending a useless read.