feat: support backend upload & existence check for persistent tasks #1551
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 introduces several improvements and refactorings across the codebase, focusing on configuration enhancements, storage engine API consistency, and ID generation capabilities. The most significant changes include adding a configurable backend upload timeout, renaming and standardizing the storage engine existence-check API, and implementing a new persistent task ID generation mechanism.
Configuration and Backend Upload Improvements
put_timeoutfield to theBackendstruct indragonfly-client-config/src/dfdaemon.rs, allowing users to configure the maximum duration for uploading objects to backend storage. This is set to 15 minutes by default, and all relevant constructors, defaults, and tests were updated to support this new field. [1] [2] [3] [4] [5]dragonfly-apito version2.2.1inCargo.toml.Storage Engine API Consistency
is_existtoexiststhroughout the codebase for clarity and consistency. This includes updates to the trait definition, all implementations, and all usages indragonfly-client-storage/src/storage_engine/mod.rs,dragonfly-client-storage/src/storage_engine/rocksdb.rs, anddragonfly-client-storage/src/metadata.rs. Associated tests were also renamed and updated to use the new method name. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]Persistent Task ID Generation Enhancements
PersistentTaskIDParameterenum and a correspondingpersistent_task_idmethod to theIDGenerator, enabling flexible persistent task ID creation based on content or file metadata. Comprehensive unit tests were added to verify correct ID generation for different parameter combinations. [1] [2] [3]gRPC Server Refactoring
DfdaemonDownloadServerand its handler to include and initialize apersistent_taskmanager, ensuring support for persistent task operations in the download server. [1] [2] [3] [4] [5] [6] [7]Related Issue
Motivation and Context
Screenshots (if appropriate)