Repository navigation
perf(fs): Improve file metastore perfomance and correctness - #743
Open
rabbitstack wants to merge 6 commits into
Open
rabbitstack wants to merge 6 commits into
rabbitstack wants to merge 6 commits into
Conversation
Every lookup calls time.Now() and does an atomic store on a shared cache line. Update only when the timestamp is more than 1s stale.
Every caller that shares a flight runs AddFile, fsMetadataCacheMisses.Add(1) and allocates its own FileInfo. The count is inflated and the stored pointer is replaced. There is also no re-check inside the flight, so a flight that just finished gets re-parsed.
Opens the file once and reads its first probeSize bytes. If accept predicate is non-nil and returns an error, the read stops there and that error is returned. Otherwise the rest of the file is read, up to size bytes in total. Cloud placeholders get hydrated. OneDrive and similar files with RECALL_ON_OPEN or RECALL_ON_DATA_ACCESS trigger a download when opened for read. That is a large I/O cost for something that will never be loaded as a module and they are skipped.
rabbitstack
commented
Oct 19, 2026
| group singleflight.Group | ||
| stop chan struct{} | ||
| closeOnce sync.Once | ||
| group singleflight.Group |
This branch has not been deployed
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.
What is the purpose of this PR / why it is needed?
This pull request brings a batch of changes to speed up and improve the correctness of the file metadata store. Best reviewed commit by commit.
What type of change does this PR introduce?
/kind bug-fix (non-breaking change which fixes an issue)
/kind improvement
Any specific area of the project related to this PR?
/area instrumentation
Special notes for the reviewer
Does this PR introduce a user-facing change?