feat: add the API for trigger the GC manually#4074
Merged
Conversation
yxxhero
previously approved these changes
May 19, 2025
gaius-qi
requested changes
May 20, 2025
Signed-off-by: chlins <chlins.zhang@gmail.com>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4074 +/- ##
==========================================
- Coverage 33.25% 33.18% -0.08%
==========================================
Files 346 346
Lines 40493 40581 +88
==========================================
Hits 13466 13466
- Misses 26134 26222 +88
Partials 893 893
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
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.
This pull request introduces a new Garbage Collection (GC) job functionality to the system, including its creation, execution, and management. The changes span across multiple files and involve updates to constants, context handling, service interfaces, and job creation logic. Below is a summary of the most important changes:
New GC Job Functionality:
GCJobto represent the GC job type ininternal/job/constants.go.CreateGCJobmethod in theservicelayer to handle the creation of GC jobs. This includes asynchronous execution and polling for job completion. [1] [2]CreateGCJobRequesttype inmanager/types/job.goto define the structure for GC job creation requests.Context Enhancements:
ContextKeyUserIDandContextKeyTaskIDinpkg/gc/gc.goto manage user and task IDs in the context, enabling better tracking of GC jobs.recorder.Initmethods inmanager/gc/audit.goandmanager/gc/job.goto include user and task IDs from the context. [1] [2]Service and Job Management Updates:
Serviceinterface inmanager/service/service.goto include the newCreateGCJobmethod.servicestruct to include agcfield for managing GC tasks, and updated its initialization in theNewfunction. [1] [2]CreateGCJobinmanager/service/mocks/service_mock.gofor testing purposes.Miscellaneous Changes:
manager/manager.gofile to properly initialize and register GC tasks using the newmanagergcpackage alias. [1] [2]jobRecorder.Initmethod to support the new GC job type by including theUserIDfield.Description
Related Issue
Motivation and Context
Screenshots (if appropriate)
Types of changes
Checklist