feat(gc): add gcTimeWindow to limit periodic GC to a local time range#4017
Open
AkashKumar7902 wants to merge 1 commit into
Open
feat(gc): add gcTimeWindow to limit periodic GC to a local time range#4017AkashKumar7902 wants to merge 1 commit into
AkashKumar7902 wants to merge 1 commit into
Conversation
Periodic garbage collection acquires storage locks that can hurt latency on high-load setups. Allow operators to confine scheduled GC to a quiet local time window (e.g. "01.00 - 08.00"), supporting both '.' and ':' separators and ranges that cross midnight. The window is honoured per-store and per-subpath, validated at config load, and applied via the GC task generator readiness check. Closes project-zot#3001 Signed-off-by: Akash Kumar <meakash7902@gmail.com>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #4017 +/- ##
==========================================
- Coverage 91.42% 91.39% -0.04%
==========================================
Files 197 198 +1
Lines 28152 28237 +85
==========================================
+ Hits 25739 25806 +67
- Misses 1562 1572 +10
- Partials 851 859 +8 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
|
@AkashKumar7902 pls fix merge conflicts and ci failures |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
gcTimeWindowstorage setting that confines scheduled garbage collection to a local time range (e.g.01.00 - 08.00), supporting both.and:separators and windows that cross midnight.examples/README.mdandexamples/config-gc-periodic.jsonso operators can discover and copy the new option.Closes #3001
Implementation notes
pkg/storage/gc/time_window.goexposesParseTimeWindow/TimeWindow.Contains. The window is empty by default (matches today's behaviour).pkg/api/controller.goplumbs the parsed window throughgc.Optionsfor both the default store and subpaths; an invalid value logs and skips scheduled GC for that store rather than failing the whole server.pkg/cli/server/root.gorejects malformed values up-front and warns when a window is set withoutgc: true.UpdateReloadableConfigcarries the new field across reloads so live config edits take effect without a restart.Test plan
go test ./pkg/storage/gc/... ./pkg/api/config/... ./pkg/cli/server/...golangci-lint runon the touched packages