feat: implement delete peer and task in persistent cache #3623
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.
Description
This pull request includes several changes to improve the handling and management of persistent cache tasks and peers in the project. The most significant changes involve the addition of new methods for managing persistent peers, the removal of the
ReplicaCount
field from tasks, and updates to various functions to handle the new structure.Improvements to Persistent Cache Management:
pkg/redis/redis.go
: AddedPersistentPeersNamespace
constant and theMakePersistentPeersOfPersistentCacheTaskInScheduler
function to handle persistent peers. [1] [2]scheduler/resource/persistentcache/peer_manager.go
: UpdatedStore
andDelete
methods to manage persistent peers and set expiration for persistent tasks. [1] [2]Task Structure and Management:
scheduler/resource/persistentcache/task.go
: Removed theReplicaCount
field from theTask
struct and updated theNewTask
function accordingly. [1] [2]scheduler/resource/persistentcache/task_manager.go
: Added methods to load current replica counts and updated theLoad
method to reflect the new task structure. [1] [2] [3] [4]Service Updates:
scheduler/service/service_v2.go
: Updated methods to handle the new task structure and to log errors more effectively. Added functionality to manage persistent replica counts. [1] [2] [3] [4] [5] [6] [7] [8]Dependency Update:
go.mod
: Updated thed7y.io/api/v2
dependency version fromv2.0.168
tov2.0.169
.Related Issue
Motivation and Context
Screenshots (if appropriate)
Types of changes
Checklist