You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by "NikitaMatskevich (via GitHub)" <gi...@apache.org> on 2026/02/07 09:15:40 UTC

[PR] docs: add an RFC for file restoration API [opendal]

NikitaMatskevich opened a new pull request, #7182:
URL: https://github.com/apache/opendal/pull/7182

   # Which issue does this PR close?
   
   <!--
   We generally require a GitHub issue to be filed for all bug fixes and enhancements. You can link an issue to this PR using the GitHub syntax. For example `Closes #123` indicates that this PR will close issue #123.
   -->
   
   Closes #https://github.com/apache/opendal/pull/7178.
   
   # Rationale for this change
   
   <!--
   Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed.
   Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes.
   -->
   
   Explained in the RFC.
   
   # What changes are included in this PR?
   
   <!--
   There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR.
   -->
   
   An RFC doc stating the future feature design choices, to be reviewed and agreed upon.


-- 
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: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] RFC-7182: file restoration API [opendal]

Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo commented on PR #7182:
URL: https://github.com/apache/opendal/pull/7182#issuecomment-4620258203

   Let's move! Thank you for your great work.


-- 
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: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] docs: add an RFC for file restoration API [opendal]

Posted by "meteorgan (via GitHub)" <gi...@apache.org>.
meteorgan commented on code in PR #7182:
URL: https://github.com/apache/opendal/pull/7182#discussion_r2777633335


##########
core/src/docs/rfcs/0000_undelete.md:
##########
@@ -0,0 +1,648 @@
+- Proposal Name: (`undelete`)
+- Start Date: 2025-02-04
+- RFC PR: [apache/opendal#7178](https://github.com/apache/opendal/pull/7178)
+- Tracking Issue: [apache/opendal#4321](https://github.com/apache/opendal/issues/4321)
+
+# Summary
+
+Implement two complementary approaches for restoring deleted files in OpenDAL:

Review Comment:
   Maybe we should first clarify what we're trying to achieve here: restoring a deleted version or file. Then we could discuss how to implement it.



-- 
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: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] docs: add an RFC for file restoration API [opendal]

Posted by "meteorgan (via GitHub)" <gi...@apache.org>.
meteorgan commented on code in PR #7182:
URL: https://github.com/apache/opendal/pull/7182#discussion_r2777634867


##########
core/src/docs/rfcs/0000_undelete.md:
##########


Review Comment:
   file name should be: 7182_restore_api



-- 
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: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] docs: add an RFC for file restoration API [opendal]

Posted by "meteorgan (via GitHub)" <gi...@apache.org>.
meteorgan commented on code in PR #7182:
URL: https://github.com/apache/opendal/pull/7182#discussion_r2777624741


##########
core/src/docs/rfcs/0000_undelete.md:
##########
@@ -0,0 +1,648 @@
+- Proposal Name: (`undelete`)
+- Start Date: 2025-02-04
+- RFC PR: [apache/opendal#7178](https://github.com/apache/opendal/pull/7178)
+- Tracking Issue: [apache/opendal#4321](https://github.com/apache/opendal/issues/4321)
+
+# Summary
+
+Implement two complementary approaches for restoring deleted files in OpenDAL:
+
+1. **Version-based restoration**: Extend the `copy` operation with an optional source `version` parameter to enable promoting non-current versions to the current version (for storage systems with versioning support)
+2. **Soft delete restoration**: Add an `undelete` operation for storage systems that implement soft delete as a distinct feature from versioning (GCS and Azure Blob Storage)
+3. Provide a high-level `restore` API that automatically chooses the right approach based on service capabilities, defaulting to versioning approach:
+
+```rust
+impl Operator {
+    pub async fn restore(&self, path: &str, version: Option<&str>) -> Result<()> {
+        let cap = self.info().full_capability();
+
+        if let Some(v) = version {
+            // Restore specific version via copy
+            if cap.versioning {
+                return self.copy_with(&path, &path).source_version(&v).await;
+            }
+        } else {
+            // Restore soft-deleted via undelete
+            if cap.undelete {
+                return self.undelete(path).await;
+            }
+
+            // Fall back to latest version via copy
+            if cap.versioning && cap.list_with_versions {
+                let version = self.get_latest_version(path).await?;
+                return self.copy_with(&path, &path).source_version(&version).await;
+            }

Review Comment:
   Would it make sense to let backends handle this themselves ?



-- 
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: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] RFC-7182: file restoration API [opendal]

Posted by "NikitaMatskevich (via GitHub)" <gi...@apache.org>.
NikitaMatskevich commented on code in PR #7182:
URL: https://github.com/apache/opendal/pull/7182#discussion_r2782636785


##########
core/src/docs/rfcs/0000_undelete.md:
##########
@@ -0,0 +1,648 @@
+- Proposal Name: (`undelete`)
+- Start Date: 2025-02-04
+- RFC PR: [apache/opendal#7178](https://github.com/apache/opendal/pull/7178)
+- Tracking Issue: [apache/opendal#4321](https://github.com/apache/opendal/issues/4321)
+
+# Summary
+
+Implement two complementary approaches for restoring deleted files in OpenDAL:
+
+1. **Version-based restoration**: Extend the `copy` operation with an optional source `version` parameter to enable promoting non-current versions to the current version (for storage systems with versioning support)
+2. **Soft delete restoration**: Add an `undelete` operation for storage systems that implement soft delete as a distinct feature from versioning (GCS and Azure Blob Storage)
+3. Provide a high-level `restore` API that automatically chooses the right approach based on service capabilities, defaulting to versioning approach:
+
+```rust
+impl Operator {
+    pub async fn restore(&self, path: &str, version: Option<&str>) -> Result<()> {
+        let cap = self.info().full_capability();
+
+        if let Some(v) = version {
+            // Restore specific version via copy
+            if cap.versioning {
+                return self.copy_with(&path, &path).source_version(&v).await;
+            }
+        } else {
+            // Restore soft-deleted via undelete
+            if cap.undelete {
+                return self.undelete(path).await;
+            }
+
+            // Fall back to latest version via copy
+            if cap.versioning && cap.list_with_versions {
+                let version = self.get_latest_version(path).await?;
+                return self.copy_with(&path, &path).source_version(&version).await;
+            }

Review Comment:
   It might be possible to abstract this logic and put it at the interface level. Its similar for many backends, that's why I kept it here. Implementing this separately in every backend would be equivalent to have restore == undelete, as one can implement undelete through versioning or soft-delete based on available capabilities.



-- 
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: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] RFC-7182: file restoration API [opendal]

Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo merged PR #7182:
URL: https://github.com/apache/opendal/pull/7182


-- 
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: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org