meteorgan commented on code in PR #5495: URL: https://github.com/apache/opendal/pull/5495#discussion_r1900651391
########## core/src/docs/rfcs/5495_list_with_deleted.md: ########## @@ -0,0 +1,81 @@ +- Proposal Name: `list_with_deleted` +- Start Date: 2025-01-02 +- RFC PR: [apache/opendal#5495](https://github.com/apache/opendal/pull/0000) +- Tracking Issue: [apache/opendal#5496](https://github.com/apache/opendal/issues/5496) + +# Summary + +Add `list_with(path).deleted(true)` to enable users to list deleted files from storage services. + +# Motivation + +OpenDAL is currently working on adding support for file versions, allowing users to read, list, and delete them. + +```rust +// Read given version +op.read_with(path).version(version_id).await; +// Fetch the metadata of given version. +op.stat_with(path).version(version_id).await; +// Delete the given version. +op.delete_with(path).version(version_id).await; +// List the path's versions. +op.list_with(path).versions().await; +``` + +However, to implement the complete data recovery workflow, we should also include support for recovering deleted files from storage services. This feature is referred to as `DeleteMarker` in S3 and `Soft Deleted` in Azure Blob Storage or Google Cloud Storage. Users can utilize these deleted files (or versions) to restore files that may have been accidentally deleted. + +# Guide-level explanation + +I suggest adding `list_with(path).deleted(true)` to allow users to list deleted files from storage services. + +```rust +let entries = op.list_with(path).deleted(true).await; +``` + +Please note that `deleted` here means "including deleted files" rather than "only deleted files." Therefore, `list_with(path).deleted(true)` will list both current files and deleted ones. + Review Comment: Does `deleted()` have to be used with `versions()` ? If so, users might not understand it right away. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
