Skip to content

feat: add the audit gc#3996

Merged
chlins merged 1 commit intomainfrom
feat/audit-gc
Apr 27, 2025
Merged

feat: add the audit gc#3996
chlins merged 1 commit intomainfrom
feat/audit-gc

Conversation

@chlins
Copy link
Copy Markdown
Member

@chlins chlins commented Apr 25, 2025

This pull request introduces a new garbage collection (GC) task for cleaning up audit records in the Dragonfly Manager. The most important changes include adding the audit GC task implementation, registering it with the GC scheduler, and defining default configurations for this task.

New Audit GC Task Implementation:

  • Added audit GC task: Implemented a new GC task in manager/gc/audit.go to periodically delete outdated audit records. The task includes configurations for batch size, interval, and timeout, and uses a RunGC method to perform the cleanup. It also integrates a job recorder to log GC results.

Integration with GC Scheduler:

  • Registered the audit GC task: Updated the manager/manager.go file to register the new audit GC task with the GC scheduler during server initialization.

Description

Related Issue

#3811
#3938

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 requested a review from a team as a code owner April 25, 2025 07:36
@chlins chlins added the enhancement New feature or request label Apr 25, 2025
@chlins chlins added this to the v2.3.0 milestone Apr 25, 2025
Signed-off-by: chlins <chlins.zhang@gmail.com>
Copy link
Copy Markdown

@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

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 25, 2025

Codecov Report

❌ Patch coverage is 0% with 49 lines in your changes missing coverage. Please review.
✅ Project coverage is 34.29%. Comparing base (50083ff) to head (e2c76d9).
⚠️ Report is 203 commits behind head on main.

Files with missing lines Patch % Lines
manager/gc/audit.go 0.00% 44 Missing ⚠️
manager/manager.go 0.00% 3 Missing ⚠️
manager/gc/job.go 0.00% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3996      +/-   ##
==========================================
- Coverage   34.31%   34.29%   -0.03%     
==========================================
  Files         342      343       +1     
  Lines       40139    40186      +47     
==========================================
+ Hits        13775    13783       +8     
- Misses      25454    25497      +43     
+ Partials      910      906       -4     
Flag Coverage Δ
unittests 34.29% <0.00%> (-0.03%) ⬇️

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

Files with missing lines Coverage Δ
manager/gc/job.go 0.00% <0.00%> (ø)
manager/manager.go 0.00% <0.00%> (ø)
manager/gc/audit.go 0.00% <0.00%> (ø)

... and 4 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@chlins chlins merged commit 50387b3 into main Apr 27, 2025
27 of 28 checks passed
@chlins chlins deleted the feat/audit-gc branch April 27, 2025 06:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request security

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants