Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: when the redis is disabled, AnnounceHost need to skip store redis #3712

Merged
merged 1 commit into from
Dec 17, 2024

Conversation

gaius-qi
Copy link
Member

@gaius-qi gaius-qi commented Dec 17, 2024

Description

This pull request introduces several changes to ensure that the persistent cache feature is only used when Redis is enabled. The changes include adding checks for the presence of the persistentCacheResource before performing operations related to the persistent cache.

Persistent Cache Feature Enhancements:

  • Added a check to initialize the persistent cache resource only if rdb is not nil in func New in scheduler/scheduler.go.
  • Updated AnnounceHost to return early if persistentCacheResource is nil, indicating that Redis is not enabled, in scheduler/service/service_v2.go.
  • Modified various methods to return an error if persistentCacheResource is nil, ensuring operations are skipped when Redis is not enabled, in scheduler/service/service_v2.go:
    • AnnouncePersistentCachePeer
    • StatPersistentCachePeer
    • DeletePersistentCachePeer
    • UploadPersistentCacheTaskStarted
    • UploadPersistentCacheTaskFinished
    • UploadPersistentCacheTaskFailed
    • StatPersistentCacheTask

Related Issue

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.

@gaius-qi gaius-qi added the enhancement New feature or request label Dec 17, 2024
@gaius-qi gaius-qi added this to the v2.2.0 milestone Dec 17, 2024
@gaius-qi gaius-qi self-assigned this Dec 17, 2024
@gaius-qi gaius-qi requested a review from a team as a code owner December 17, 2024 14:55
Copy link

codecov bot commented Dec 17, 2024

Codecov Report

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

Project coverage is 35.17%. Comparing base (a370da1) to head (3af60b5).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
scheduler/service/service_v2.go 0.00% 26 Missing and 1 partial ⚠️
scheduler/scheduler.go 0.00% 6 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3712      +/-   ##
==========================================
- Coverage   35.24%   35.17%   -0.07%     
==========================================
  Files         335      335              
  Lines       37775    37803      +28     
==========================================
- Hits        13314    13298      -16     
- Misses      23635    23676      +41     
- Partials      826      829       +3     
Flag Coverage Δ
unittests 35.17% <0.00%> (-0.07%) ⬇️

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

Files with missing lines Coverage Δ
scheduler/scheduler.go 0.00% <0.00%> (ø)
scheduler/service/service_v2.go 67.28% <0.00%> (-1.19%) ⬇️

... and 3 files with indirect coverage changes

@gaius-qi gaius-qi merged commit 063a20d into main Dec 17, 2024
22 of 27 checks passed
@gaius-qi gaius-qi deleted the feature/persistent branch December 17, 2024 15:03
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.

1 participant