feat: replicate the persistent cache task when delete host #3787
+322
−93
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 changes to the persistent cache task management and scheduling logic, as well as updates to mock implementations and dependency versions. The most important changes focus on adding new methods for updating persistent cache tasks, improving the handling of peer states, and refining the scheduling logic.
Persistent Cache Task Management:
UpdatePersistentCacheTask
method toV2
interface and its implementation inclient_v2.go
to update persistent cache task information. [1] [2]peer_manager.go
to correctly set task joint-set TTL and handle peer deletion more robustly by using the task ID instead of host ID. [1] [2] [3] [4] [5]Scheduling Logic:
FindReplicatePersistentCacheHosts
method to return both cached and non-cached replicate hosts, improving the scheduling process for persistent cache tasks. [1] [2] [3] [4] [5] [6] [7]Mock Implementations:
UpdatePersistentCacheTask
inclient_v2_mock.go
andseed_peer_client_mock.go
. [1] [2]peer_manager_mock.go
.Dependency Updates:
d7y.io/api/v2
dependency version fromv2.1.18
tov2.1.21
ingo.mod
.Peer State Handling:
service_v2.go
to set peer state to failed if various peer operations fail, ensuring more accurate state tracking.Related Issue
Motivation and Context
Screenshots (if appropriate)
Types of changes
Checklist