noobaa-core icon indicating copy to clipboard operation
noobaa-core copied to clipboard

NSFS unneeded read calls to warmup sparse file

Open guymguym opened this issue 8 months ago • 1 comments

Environment info

  • NooBaa Version: 5.15
  • Platform: RHEL

Actual behavior

  1. 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

  1. 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.
  2. Other option is to always check stat before each read, which seems wasteful too.

Steps to reproduce

  1. Read a large sparse file using NSFS that becomes non-sparse on read (transparent recall / fetch).
  2. See how every loop we keep on logging the "warmup sparse file" message and sending a useless read.

More information - Screenshots / Logs / Other output

guymguym avatar Jun 25 '24 22:06 guymguym