mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-11-16 00:38:53 +01:00
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:
3 files changed
+129
-1
No files matched your search
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user