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 post-restore eviction // passes when dirty pages are waiting for background kernel 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 writes each path's dirty pages to disk in the background and then calls done, if set. Writing can block on a busy disk, and callers don't wait.
func SyncAndEvict ¶ added in v1.0.1
func SyncAndEvict(targets []File)
SyncAndEvict waits for targets to reach disk and then evicts them, so pages still dirty from a recent snapshot get dropped too.