tracking: implement restore for additional services

Aperta
#8,158 0 commenti 1 reazione 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
30/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
azure, google-cloud, rust
Ambito
api, backend, cloud

Direzione di ricerca

Scegli un provider non selezionato, quindi leggi il relativo punto di ingresso citato in backend.rs o core.rs e la documentazione dell’API del provider collegata. Verifica il comportamento di recovery e delle capability del provider con test sul servizio effettivo e una configurazione preimpostata. Il lavoro è completato quando la checklist di accettazione applicabile passa senza modificare la semantica esistente di delete.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement releases-note/feat research services/aliyun_drive services/azblob services/b2 services/cos services/dropbox services/gcs services/gdrive services/obs services/onedrive services/oss services/s3 services/tos services/yandex_disk

Context

Operator::restore and the first S3 implementation landed in #8143. This issue turns the API discussion in #4321 into a service implementation tracker.

The checklist includes services whose providers expose versioning, delete markers, soft deletion, revisions, or a recycle bin. Other services should keep returning Unsupported until a provider-native recoverable state is identified.

Contract

Each implementation must preserve the public restore contract:

  • restore(path) succeeds for a live object, restores the latest service-native deleted state, and returns NotFound when no live or recoverable state exists.
  • restore_with(path).version(version) makes the selected historical version current.
  • if_not_exists is advertised only when the provider offers an atomic destination condition.
  • One restore call reverses one provider-native deletion state. For services that stack delete markers, repeated calls may expose progressively older states.
  • Capabilities must reflect the configured provider and must not be inferred only from a compatible API shape.

Status

Completed
  • S3 — #8143 implements current delete-marker removal and version-selected server-side copy. S3 Express keeps restore capabilities disabled because it does not support versioning.
Version and delete-marker services
  • COS — OpenDAL already exposes versioned stat/read/delete/list and deleted-entry listing (capabilities). Implement path restore by deleting the current delete marker, and selected-version restore with CopyObject's source versionId (COS API). Do not advertise conditional restore until an atomic versioned-destination condition is proven against COS.
  • OSS — #9094 implements restore of the current delete marker and restore from a selected historical version. Verified on small objects in a version-enabled OSS bucket.
  • TOS — #9094 implements restore of the current delete marker when data versions survive, and restore from a selected historical version. Verified on small objects in a version-enabled TOS bucket.
  • OBS — OBS supports versioning, delete markers, and undelete (OBS User Guide, “Undeleting an Object”). OpenDAL does not yet expose OBS version list/read/delete/copy primitives, so add those prerequisites before restore.
Native soft-delete, revision, and recycle-bin services
  • Azure Blob — Use Undelete Blob for soft-delete-only accounts (REST API). With blob versioning, discover a previous version and copy it to the base blob (versioning behavior). OpenDAL's copy request already accepts a source versionid (source). #7178 closed in favor of restore. In the real Azure fixture used for #6274, two ordinary blob PUTs returned no version IDs and both deletes returned 202 with x-ms-delete-type-permanent: true. Undelete still needs verification with soft delete enabled and versioning disabled. Version promotion can be verified separately on a version-enabled fixture with two identifiable versions of the same blob. (AI-generated verification note)
  • GCS — #9106 implements restore on the authenticated default endpoint. A live object is preserved. For a missing path, OpenDAL scans its ordinary and soft-deleted generations and restores the most recently deleted generation while the destination is absent. A selected generation can be promoted with an optional destination-absence condition. Verified on a flat-namespace bucket with versioning and seven-day soft delete.
    • Support soft-deleted generations that require a hierarchical namespace restoreToken. These currently return Unsupported. GCS restore API
  • Backblaze B2 — #9104. Path restore preserves a live file or removes one current hide marker when a data version survives. Version-selected restore promotes the requested file ID with b2_copy_file, subject to its single-copy size limit.
  • Dropbox — files/restore(path, rev) requires a revision. When Dropbox includes rev in an upload response, OpenDAL returns it as Metadata::version in the write result. Ordinary stat and list do not return that revision. Determine how to select a revision for restore_with(...).version(...) and verify the behavior on Dropbox. Path-only restore must still discover a recoverable revision after deletion. (AI-generated verification update.)
  • Google Drive — OpenDAL delete moves files to trash (source). In My Drive, setting trashed=false on the only matching trashed file (Drive API guide) restored the same file ID, and OpenDAL read back all 48 original bytes. With a live replacement at the same path, OpenDAL read the replacement, the original ID stayed in trash, and restore(path) returned Unsupported. For two trashed files with the same parent and name, both files.get and files.list omitted the requested trashedTime. orderBy=trashedTime desc returned HTTP 400, so this lookup could not identify the latest deletion. (AI-generated verification note)
  • OneDrive Personal (AI-generated note). Verify recovery of the latest recoverable deletion using only the original path. Graph’s driveItem restore requires a deleted item ID and lists Files.ReadWrite.All as the least delegated permission for personal accounts. OpenDAL’s refresh flow requests Files.ReadWrite. A previously saved item ID tests only the ID-based action. OpenDAL lists versions of live files. Graph’s restoreVersion takes both the item ID and version ID, creates a new current version, and lists Files.ReadWrite as sufficient. Promotion and readback on a real account remain unverified.
Investigation or blocked
  • Aliyun Drive resolves the file ID and calls POST /adrive/v1.0/openFile/delete. The consumer Alipan API documents openFile/recyclebin/trash as a separate operation. Verification remains open pending evidence from the consumer service that OpenDAL’s existing delete leaves a recoverable item, that the item can be found by its original path, and that it can be restored to that path. (AI-generated verification update.)
  • Yandex Disk — OpenDAL currently deletes with permanently=true (source). Restore is blocked until a separate decision changes or parameterizes delete semantics; restore work must not silently change existing delete behavior.

Pull request acceptance checklist

Every service PR should cover the applicable items:

  • Advertise only capabilities verified for the configured provider.
  • Succeed when the path is already live.
  • Restore one recoverable deleted state.
  • Return NotFound for an unknown or permanently deleted path.
  • Promote the selected version when restore_with_version is advertised.
  • Prove both success and conflict behavior against the actual service when restore_with_if_not_exists is advertised.
  • Verify repeated deletion/restoration behavior when the provider stacks markers or revisions.
  • Add actual-service behavior coverage and preset configuration.
  • Document provider-specific prerequisites and limitations.

Provider documentation and request-construction analysis establish feasibility, but they do not replace actual-service behavior tests.

Non-goals

  • Changing a service's existing delete semantics inside a restore PR.
  • Downloading and re-uploading object data when the provider offers native server-side recovery or copy.
  • Claiming recovery for unversioned, expired, or permanently deleted data.
Lingua principale
Rust
Stelle
5.5k
Fork
869
Merge medio
8h 2m
PR unite (30g)
862

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di apache/opendal

Tutte le issue di apache/opendal

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.