Inode metadata is permanently cached, so if you change a directory's contents outside of AlgoFS, you have to unmount and remount AlgoFS before those changes appear.
I'd like to avoid losing the lookup perf, so my inclination is to take a double-cache approach with 2 TTLs:
if the long TTL is expired, then consider the cached inode invalid and block on lookup
if the short TTL (e.g. 30s) is expired, respond with cached entry, but trigger a background lookup via API. This way, if you get a false "file not found", it will generally work on a subsequent request a couple seconds later
if neither TTL is expired, respond with cached entry
Since this is a perf vs correctness tradeoff, these TTLs should probably be configurable options.
Inode metadata is permanently cached, so if you change a directory's contents outside of AlgoFS, you have to unmount and remount AlgoFS before those changes appear.
I'd like to avoid losing the
lookup
perf, so my inclination is to take a double-cache approach with 2 TTLs:Since this is a perf vs correctness tradeoff, these TTLs should probably be configurable options.