volume: skip TTL last-write scan when it cannot fit its budget (#11472)

* volume: skip TTL last-write scan when it cannot fit its budget

* Update weed/storage/volume_checking.go

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

---------

Co-authored-by: Chris Lu <chrislusf@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This commit is contained in:
authored and GitHub committed 2026-09-26 19:41:59 +08:00
1 parent 7129e1178e
commit 80fd3635d2
3 files changed
+129 -1

No files matched your search

+9 -1
View File
@@ -11,7 +11,9 @@ import (
"github.com/stretchr/testify/require"
)
// countingBackend counts Sync calls and can be made to fail them.
// countingBackend counts Sync calls and can be made to fail them. It also
// counts random reads, so recovery paths can prove they declined before
// touching the .dat.
type countingBackend struct {
backend.BackendStorageFile
syncCount int
@@ -19,6 +21,12 @@ type countingBackend struct {
syncErrOnce bool
truncateErr error
truncateCount int
readCount int
}
func (b *countingBackend) ReadAt(p []byte, off int64) (int, error) {
b.readCount++
return b.BackendStorageFile.ReadAt(p, off)
}
func (b *countingBackend) Sync() error {