Skip to content

fix(job): support config sync peer task batch size#4654

Open
CooooolFrog wants to merge 2 commits intodragonflyoss:mainfrom
CooooolFrog:fix_redis_big_key
Open

fix(job): support config sync peer task batch size#4654
CooooolFrog wants to merge 2 commits intodragonflyoss:mainfrom
CooooolFrog:fix_redis_big_key

Conversation

@CooooolFrog
Copy link
Copy Markdown
Contributor

@CooooolFrog CooooolFrog commented Mar 11, 2026

Description

This PR addresses the Redis big key issue caused by SyncPeerJob when there are too many peers.

Related Issue

#4379

Motivation and Context

Dragonfly uses this library (https://github.com/RichardKnop/machinery) as a distributed task processor. This framework uses Redis as a task queue to store job requests and execution results (e.g. key JobResultId, value PeerHostInfos). The reason for big key problem in Redis is that the task result stores information for all peers.

I saw the group task scheduling in the machinery library, so I plan to split a job into multiple sub-jobs for execution. This would reduce the number of PeerHostInfo entries stored in a single sub-job, thus solving the big key problem.

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.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 11, 2026

Codecov Report

❌ Patch coverage is 6.89655% with 54 lines in your changes missing coverage. Please review.
✅ Project coverage is 28.07%. Comparing base (07054a5) to head (bcf97b2).
⚠️ Report is 35 commits behind head on main.

Files with missing lines Patch % Lines
manager/job/sync_peers.go 0.00% 30 Missing ⚠️
scheduler/job/job.go 0.00% 24 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4654      +/-   ##
==========================================
- Coverage   28.66%   28.07%   -0.59%     
==========================================
  Files         231      232       +1     
  Lines       23052    23141      +89     
==========================================
- Hits         6607     6496     -111     
- Misses      15983    16204     +221     
+ Partials      462      441      -21     
Flag Coverage Δ
unittests 28.07% <6.89%> (-0.59%) ⬇️

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

Files with missing lines Coverage Δ
manager/config/config.go 96.11% <100.00%> (+0.28%) ⬆️
scheduler/job/job.go 0.00% <0.00%> (ø)
manager/job/sync_peers.go 0.00% <0.00%> (ø)

... and 3 files with indirect coverage changes

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

@CooooolFrog CooooolFrog requested a review from gaius-qi March 12, 2026 08:47
@CooooolFrog CooooolFrog changed the title [WIP] fix(job): support config sync peer task batch size fix(job): support config sync peer task batch size Mar 12, 2026
@CooooolFrog CooooolFrog requested review from a team as code owners March 31, 2026 07:57
Signed-off-by: CooooolFrog <zuliangwanghust@gmail.com>
Signed-off-by: CooooolFrog <zuliangwanghust@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants