GitHub user QazCetelic edited a comment on the discussion: Return whether file
has been deleted succesfully when `delete` is used.
Thanks for taking the time to answer. Apologies for the delayed response. I was
quite busy.
I've been experimenting with OpenDAL by trying to implement a distributed FIFO
message queue. My specific use case is that I want to "move" a file once (this
often means copying and deleting a file) and want to detect if another process
connected to the same storage backend does so concurrently to avoid duplicating
files.
```mermaid
sequenceDiagram
participant ProcessA
participant ProcessB
participant StorageBackend
Note over StorageBackend: Initial state: File exists at /source/file.txt
ProcessA->>StorageBackend: Check if /source/file.txt exists
ProcessB->>StorageBackend: Check if /source/file.txt exists
StorageBackend-->>ProcessA: File exists
StorageBackend-->>ProcessB: File exists
ProcessA->>StorageBackend: COPY /source/file.txt to /destA/file.txt
ProcessB->>StorageBackend: COPY /source/file.txt to /destB/file.txt
StorageBackend-->>ProcessA: COPY successful
StorageBackend-->>ProcessB: COPY successful
ProcessA->>StorageBackend: DELETE /source/file.txt
ProcessB->>StorageBackend: DELETE /source/file.txt
StorageBackend-->>ProcessA: DELETE successful
StorageBackend-->>ProcessB: DELETE successful
Note over ProcessA,ProcessB: Both processes think they "moved" the file
Note over StorageBackend: File duplicated at /destA/file.txt AND
/destB/file.txt
```
However, considering S3 apparently always returns the same response when
deleting a file, I'll just implement it using the following procedure:
1. Copy file
2. Wait
3. Stat file to see if it exists
4a. Delete source file
4b. Delete new file
GitHub link:
https://github.com/apache/opendal/discussions/7414#discussioncomment-16673408
----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: [email protected]