This pull request modifies the Cache's size field type, adds storage layer support for CacheTask, and implements related processing for CacheTask metadata.
- Reconstruct the Cache structure, changing the size field to Arc<AtomicU64> to achieve internal mutability and state sharing.
- Created a new CacheTask metadata structure and implemented its associated processing functions.
- Added CacheTask support in the storage layer, implementing all necessary functions for its download functionality.
To provide storage layer support for CacheTask, laying the foundation for future CacheTask integration into the client.
Signed-off-by: fu220 <2863318196@qq.com>
This pull request removes the load_to_cache field and adds trait method definitions to dfdaemon_download.rs and dfdaemon_upload.rs.
- Removed cache-related processing from Task handling.
- Added trait method definitions such as download_cache_task to dfdaemon_download.rs and dfdaemon_upload.rs to comply with the API format of version 2.1.55.
- Aim to allow Task to focus on disk interactions while delegating memory cache operations to CacheTask.
Signed-off-by: fu220 <2863318196@qq.com>
feat(dragonfly-client-storage): add write_piece_timeout to storage config and enhance piece download timeout handling
This change introduces a `write_piece_timeout` configuration to the storage module, allowing customizable timeouts for writing pieces to storage (e.g., disk or cache). The default timeout is set to 90 seconds. The total timeout for piece operations now combines `download.piece was timeout` and `storage.write_piece_timeout`. Key changes include:
- Added `write_piece_timeout` field to `Storage` config with default and serialization support.
- Updated `wait_for_piece_finished` and `wait_for_piece_finished_by_task_id` to use combined timeout (`download.piece_timeout + storage.write_piece_timeout`).
- Introduced `DownloadPieceFinished` error for piece download timeouts and refactored `download_piece_from_source_finished` and `download_piece_from_parent_finished` to enforce timeouts using `tokio::select!`.
- Increased default `download.piece_timeout` from 60s to 120s for robustness.
- Removed `wait_for_piece_count` debug logging to simplify code.
- Updated tests to validate `write_piece_timeout` parsing.
These changes improve timeout granularity and reliability for piece operations.
Signed-off-by: Gaius <gaius.qi@gmail.com>
* feat: support fallocate and filling zero for creating task
* feat: support fallocate and filling zero for creating task
---------
Signed-off-by: Gaius <gaius.qi@gmail.com>
- Bumped version from 0.2.18 to 0.2.19 across all packages
- Modified hard link logic in content.rs to:
- Move existence check after initial hard link attempt
- Handle AlreadyExists error case more gracefully
- Apply consistent behavior for both regular and persistent cache tasks
- Maintains original functionality while improving error handling flow
Signed-off-by: Gaius <gaius.qi@gmail.com>
* feat: change crc to crc32fast
Signed-off-by: Gaius <gaius.qi@gmail.com>
* feat: update
Signed-off-by: Gaius <gaius.qi@gmail.com>
* feat: update
Signed-off-by: Gaius <gaius.qi@gmail.com>
---------
Signed-off-by: Gaius <gaius.qi@gmail.com>
- Bump all crate versions from 0.2.15 to 0.2.16
- Add cross-platform device/inode check for hard link operations
- Refactor hard link logic to remove redundant helper methods
- Implement proper file existence checks with same-device/inode validation
Signed-off-by: Gaius <gaius.qi@gmail.com>