Conversation
Mesa DescriptionThis PR introduces a prefetching mechanism to improve the performance of directory listing operations. By proactively fetching metadata and populating the inode cache, these changes aim to reduce latency when browsing organizations and repositories. The core changes include:
Description generated by Mesa. Update settings |
There was a problem hiding this comment.
Performed full review of b6f03ac...d893741
Analysis
-
The new fire-and-forget prefetch design introduces an uncoordinated background workload path that could potentially overwhelm the remote metadata service when processing large directory listings.
-
The implementation lacks proper concurrency controls, rate-limiting, or backpressure mechanisms to prevent excessive RPC calls from being issued to the resolver.
-
The PR modifies core caching behavior (making AsyncICache cloneable via Arc) but doesn't appear to consider potential resource utilization implications across the system when many prefetch tasks are spawned simultaneously.
Tip
Help
Slash Commands:
/review- Request a full code review/review latest- Review only changes since the last review/describe- Generate PR description. This will update the PR body or issue comment depending on your configuration/help- Get help with Mesa commands and configuration options
0 files reviewed | 1 comments | Edit Agent Settings • Read Docs
Replace evict_zero_rc_children calls with evict_stale_children in readdir paths. The new method only evicts rc=0 children whose names are NOT in the current directory listing, preserving prefetched grandchild inodes.
All production callers now use evict_stale_children which preserves prefetched children. Update evict_cleans_child_index test to use evict_stale_children with an empty set instead.
Add trace logging to ensure_child_ino (cache hit vs allocation), evict_stale_children (eviction counts), forget (child_index cleanup), and readdir eviction results in both RepoFs and CompositeFs.
Two fixes for prefetch reliability: 1. ensure_child_ino now validates that the cached inode still exists in the inode_table before returning it. If a failed prefetch (rc=0) caused get_or_resolve to evict the entry from inode_table without cleaning up child_index, the stale mapping is removed and a fresh inode is allocated. This prevents cascading lookup failures. 2. Prefetch failures are now logged at warn! level (was trace!) so they're visible with normal log settings. Includes the error message for easier debugging.
Switch the entire Fs stack from &mut self to &self so FuserAdapter can spawn a tokio task per FUSE request instead of blocking the session loop with block_on. This unblocks concurrent request processing — a slow API call no longer stalls all other FUSE operations. Key changes: - Fs trait: &self, Send+Sync+'static bounds, readdir returns Vec<DirEntry> - HashMapBridge: wrap BiMaps in std::sync::RwLock for interior mutability - CompositeFs: slots in tokio::sync::RwLock, inode maps in scc::HashMap - RepoFs/OrgFs/MesaFS: all mutable state behind concurrent containers - FuserAdapter: fs wrapped in Arc<F>, each method spawns instead of block_on
No description provided.