-
Notifications
You must be signed in to change notification settings - Fork 413
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clean up temporary space more proactively #35
Comments
Rambling stream of consciousness plan:
This will work about how we want for reading, I think. Transitioning from dirty to clean, this will also work fine. From clean to dirty it might not be so great, especially if the work in #38 causes the file to be busted up. Oh well, this may not be a frequent case, and anyway this is a start. |
By the way, for now let's just have the write lease type stat the temporary file to get the length anew (for reporting to the leaser) on every modification. We can make this more subtle later if we really need to. |
To do:
|
It is a simple wrapper around lease.ReadProxy. For #35.
For now, we don't do anything useful regarding file leasers. For #35.
Still to do:
|
Confirmed everything works with hacked up binary at 2e3c25e. |
This sidesteps the race identified in #35.
Currently we destroy an inode's temporary files only when the kernel tells us to forget it. I believe the kernel does this only when it is running out of space in its inode cache, at least if the file hasn't been unlinked. In contrast, one temporary file per inode can grow to a lot of disk space, and we may want to clean up earlier.
Consider setting a (configurable) limit on the amount of disk space devoted to temporary files. The limit may be exceeded if we have dirty inodes that add up to more than the limit. But if we are over the limit and have any clean inodes, we will throw away their content (in least recently used order?) until we are under the limit or run out of clean inodes.
How to plumb this in? Some sort of central object used by the object proxies. They use a "grab file if still exists" method when clean, and a "register dirty file" and "unregister dirty file" methods when transitioning into and out of the dirty state. Something like that.
The text was updated successfully, but these errors were encountered: