Conversation
There was a problem hiding this comment.
Pull request overview
This PR enhances the cache-mode behavior in the unified filesystem by improving get_status for cached files, introducing single-flight mount refresh to avoid redundant concurrent RPC calls, and making the async_cache method fire-and-forget to avoid blocking the caller.
Changes:
get_statusnow branches by no-mount / FS mode / cache mode: in cache mode it first checks CV status and validates against UFS, falling back to UFS when cache is invalid;CacheValidity::Invalidnow carries anOption<FileStatus>to reuse the UFS status fetched during validation, avoiding duplicate UFS calls.async_cacheis now a synchronous fire-and-forget method that spawns the job submission in a background task, andopen_with_optsinvalidates the CV cache before writing to UFS in cache mode. Additionally, FUSEflush/releaseonly invalidate meta cache when the file was opened for writing.MountCache::check_updateuses atokio::sync::Mutexfor double-checked locking to ensure only one task performs the full mount refresh when the TTL expires. The server now forbids deletion of mount point root directories.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
curvine-client/src/unified/unified_filesystem.rs |
Cache-mode get_status with validity check/fallback; fire-and-forget async_cache; cache invalidation on write open; CacheValidity::Invalid now carries optional FileStatus |
curvine-client/src/unified/mount_cache.rs |
Single-flight mount refresh via tokio::sync::Mutex with double-checked locking pattern |
curvine-server/src/master/master_handler.rs |
Forbid deletion of mount point root directory |
curvine-fuse/src/fs/curvine_file_system.rs |
Conditional meta cache invalidation on flush/release only when writer exists |
curvine-tests/tests/write_cache_test.rs |
Updated test to match new synchronous async_cache signature |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
…sync_cache fire-and-forget - unified_filesystem: get_status branches by no-mount / FS mode / cache mode; in cache mode calls cv.get_status then check_cache_validity, falls back to UFS when invalid or on error; CacheValidity gains Invalid(Option<FileStatus>) to carry UFS status - unified_filesystem: add invalidate_cache, clear CV cache before open-for-write on mount path; async_cache becomes fire-and-forget (spawn load job in background, return immediately) - mount_cache: single-flight refresh via refresh_lock to avoid blocking all get_mount while holding write lock during RPC - master_handler: forbid delete of mount point root (error when path == mount.cv_path) - curvine_fuse: call invalidate_cache only when handle.writer.is_some() (invalidate cache only after flush/release when file was opened for write)
szbr9486
approved these changes
Mar 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…sync_cache fire-and-forget