feat: add gc task to clean up inactive seed peers #4176
Merged
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) task for cleaning up inactive seed peers, refactors the GC task registration process for better maintainability, and updates a submodule reference. Below is a summary of the most important changes:
New Seed Peer GC Task Implementation:
manager/gc/seed_peer.go
to clean up inactive seed peers. This includes constants for default configurations (e.g., TTL, batch size, interval) and aRunGC
method to perform the cleanup using database operations.Refactoring of GC Task Registration:
manager/manager.go
by introducing a newregisterGCTasks
function. This consolidates the registration logic for all GC tasks, including the new seed peer GC task. [1] [2]Submodule Update:
client-rs
submodule reference to a new commit (7cf69832a842a683a01c9c3ff9aed354bb72ff8e
).Dependency Addition:
gorm.io/gorm
package to the imports inmanager/manager.go
to support database operations for the new GC task.Description
Related Issue
Completed task of #4179
Motivation and Context
Screenshots (if appropriate)
Types of changes
Checklist