Skip to content

Conversation

chlins
Copy link
Member

@chlins chlins commented Jul 3, 2025

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:

  • Added a new GC task in manager/gc/seed_peer.go to clean up inactive seed peers. This includes constants for default configurations (e.g., TTL, batch size, interval) and a RunGC method to perform the cleanup using database operations.

Refactoring of GC Task Registration:

  • Refactored the GC task registration in manager/manager.go by introducing a new registerGCTasks function. This consolidates the registration logic for all GC tasks, including the new seed peer GC task. [1] [2]

Submodule Update:

  • Updated the client-rs submodule reference to a new commit (7cf69832a842a683a01c9c3ff9aed354bb72ff8e).

Dependency Addition:

  • Added the gorm.io/gorm package to the imports in manager/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

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation Update (if none of the other choices apply)

Checklist

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.

@chlins chlins added this to the v2.4.0 milestone Jul 3, 2025
@chlins chlins requested a review from a team as a code owner July 3, 2025 09:11
@chlins chlins requested review from jim3ma, BraveY and fcgxz2003 July 3, 2025 09:11
@chlins chlins added the enhancement New feature or request label Jul 3, 2025
Signed-off-by: chlins <chlins.zhang@gmail.com>
@chlins chlins force-pushed the feat/gc-inactive-seed-peers branch from 25c9006 to 6c4a9f7 Compare July 3, 2025 09:13
@chlins chlins enabled auto-merge (squash) July 3, 2025 09:14
Copy link
Member

@gaius-qi gaius-qi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link

codecov bot commented Jul 3, 2025

Codecov Report

Attention: Patch coverage is 0% with 60 lines in your changes missing coverage. Please review.

Project coverage is 32.86%. Comparing base (b3b7d15) to head (6c4a9f7).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
manager/gc/seed_peer.go 0.00% 44 Missing ⚠️
manager/manager.go 0.00% 16 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4176      +/-   ##
==========================================
- Coverage   32.90%   32.86%   -0.05%     
==========================================
  Files         347      348       +1     
  Lines       40992    41044      +52     
==========================================
  Hits        13490    13490              
- Misses      26608    26660      +52     
  Partials      894      894              
Flag Coverage Δ
unittests 32.86% <0.00%> (-0.05%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
manager/manager.go 0.00% <0.00%> (ø)
manager/gc/seed_peer.go 0.00% <0.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link

@Liam-Zhao Liam-Zhao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@chlins chlins merged commit 9fb26ae into main Jul 3, 2025
16 checks passed
@chlins chlins deleted the feat/gc-inactive-seed-peers branch July 3, 2025 09:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants