From 8c2c92f7afdc8386b000c0cb57ecec2ee1f5bcb0 Mon Sep 17 00:00:00 2001 From: Klaus Post Date: Fri, 28 Feb 2025 01:55:16 -0800 Subject: [PATCH] Fix healing probability for skipped folders (#20988) We must update the heal probability when selectively skipping folders. --- cmd/data-scanner.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmd/data-scanner.go b/cmd/data-scanner.go index e4ae60f68..8c5917077 100644 --- a/cmd/data-scanner.go +++ b/cmd/data-scanner.go @@ -664,6 +664,12 @@ func (f *folderScanner) scanFolder(ctx context.Context, folder cachedFolder, int into.addChild(h) continue } + // Adjust the probability of healing. + // This first removes lowest x from the mod check and makes it x times more likely. + // So if duudc = 10 and we want heal check every 50 cycles, we check + // if (cycle/10) % (50/10) == 0, which would make heal checks run once every 50 cycles, + // if the objects are pre-selected as 1:10. + folder.objectHealProbDiv = dataUsageUpdateDirCycles } f.updateCurrentPath(folder.name) stopFn := globalScannerMetrics.log(scannerMetricScanFolder, f.root, folder.name)