snapshotcache

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 14, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

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

View Source
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

func DropFile(t File)

DropFile unlinks t.Path if it still refers to the same inode and size.

func DropFiles

func DropFiles(files []File)

DropFiles calls DropFile for each file in files.

func EvictFiles

func EvictFiles(targets []File) bool

EvictFiles evicts clean cached pages of targets via POSIX_FADV_DONTNEED and returns true if any target still exists and has pages (clean or dirty) remaining in cache. 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.

Types

type File

type File struct {
	Path string
	Info fs.FileInfo
}

File identifies a snapshot data file pinned by its FileInfo at discovery time so delayed post-writeback passes cannot evict or unlink a newer file written at the same path.

func FindFiles

func FindFiles(dir string, match func(name string) bool) []File

FindFiles walks dir and returns regular files whose base name satisfies match, pinned by their FileInfo at discovery time.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL