Documentation
¶
Overview ¶
Package snapshotcache disposes of staged restore files and evicts preserved snapshot files from the host page cache after an actor restore completes.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // RetryDelays are the backoff intervals between EvictWithRetries passes // while dirty pages wait for writeback. RetryDelays = []time.Duration{ 500 * time.Millisecond, 1500 * time.Millisecond, 3000 * time.Millisecond, } )
Functions ¶
func DropFile ¶
DropFile unlinks t.Path if it still refers to the same inode and size, and reports whether the file was removed.
func DropFiles ¶
DropFiles calls DropFile for each file in files and reports whether any file was removed.
func EvictFiles ¶
EvictFiles evicts clean cached pages of targets via POSIX_FADV_DONTNEED and returns true if any target still has dirty or writeback pages remaining in cache (or if fadvise failed). Files with dirty or writeback pages are skipped so FADV_DONTNEED never forces synchronous disk writeback I/O.
func EvictWithRetries ¶
func EvictWithRetries(targets []File)
EvictWithRetries runs EvictFiles immediately and, while pages remain in cache, retries after each interval in RetryDelays to evict pages once background kernel writeback cleans them.
func StartWriteback ¶ added in v1.0.0
StartWriteback opens paths and, in the background, waits for each file's dirty pages to be written back or for the file to be unlinked, then calls done once. If a path can't be opened it returns the error, holds nothing, and never calls done.