jonocodes opened a new pull request, #9443:
URL: https://github.com/apache/opendal/pull/9443
# Which issue does this PR close?
No issue. This is the write/delete follow-up to #9359, as planned in
Discussion #8443.
# Rationale for this change
#9359 added the remoteStorage service read-only. This adds write and delete,
so the service can be used for more than reading. Conditional writes and
deletes (`if_match`, `if_not_exists`) will follow in a separate PR.
# What changes are included in this PR?
```diff
core/services/remotestorage/src/
+├── writer.rs # one-shot PUT with Content-Type
+├── deleter.rs # DELETE; folder paths are a no-op, 404 counts as deleted
├── core.rs # + put / delete requests; 409 maps to Conflict
└── backend.rs # + write, write_with_content_type, delete
```
Protocol decisions a reviewer should check:
- **`write_can_empty` stays false.** Servers accept empty documents, but
with `list` and `write_can_empty` the simulate layer fakes `create_dir` by
writing an empty document at the folder path (`dir/`), which remoteStorage
servers reject with `400`. Folders exist only while they contain documents.
Advertising it made 15 behavior tests fail on RSilo.
- **Deleting a folder path is a no-op.** A folder disappears with its last
document, and servers reject `DELETE` on a folder path, which broke recursive
delete. A missing document (`404`) counts as deleted.
- **`test_remove_all_with_prefix_exists` skips remoteStorage**, next to the
existing Hugging Face skip. It writes a document `parent` and documents under
`parent/a`, and the draft requires a `409` "where the document name coincides
with an existing folder's name at the same level". The test's doc comment
already says it needs flat key storage; its gate, `!cap.create_dir`, stands in
for that and lets remoteStorage through. Fixing the gate would touch every
service, so I kept to the skip; happy to change it if you prefer.
- **Status codes.** Any 2xx counts as success, as draft section 5 specifies.
The `409` for a document/folder name clash now maps to `ErrorKind::Conflict`
instead of `Unexpected`; this also applies to the `409` armadietto sends for a
GET on such a path.
- **CI.** RSilo now runs the full read/write suite with random roots, so it
no longer seeds fixtures. armadietto stays on the read-only suite
(`OPENDAL_TEST_CAPABILITY_OVERRIDES=write=false,delete=false`), because the
released modular server exits when a client drops a response mid-stream, which
several read/write tests do. I reported that upstream as
remotestorage/armadietto#182, with a fix in remotestorage/armadietto#183. Once
a release includes it, armadietto can run the full suite.
# Are there any user-facing changes?
Yes. The remoteStorage service now supports `write` (with `content_type`,
defaulting to `application/octet-stream`) and `delete`. The service docs
describe folder behavior, name conflicts, empty documents and the armadietto
caveats.
# Breaking changes
# Evidence
Behavior tests (`OPENDAL_TEST=remotestorage cargo test behavior --features
tests,services-remotestorage`), run locally through each CI `action.yml` with
Docker Compose:
| Setup | Suite | Result |
|---|---|---|
| RSilo `0.4.0` | full read/write | 112 passed |
| armadietto modular `2026-08-29-20-39` | read-only (override) | 16 passed |
These counts are on top of current `main`, after #9424 consolidated some
behavior tests; the figures below were measured before that. Before the
`write_can_empty` and folder-delete changes, RSilo failed 18 of the 118
read/write tests. Against armadietto built from remotestorage/armadietto#183,
the full read/write suite keeps the server up: 104 passed. The remaining
failures are ranged reads, which armadietto doesn't support, a `;
charset=utf-8` suffix it adds to content types, and recursive-delete listing,
which I haven't investigated yet.
Against 5apps, with a real OAuth token scoped to a test category, a smoke
test passed 33 of 33 checks, including writing a JSON document with its content
type, reading it back, overwriting it (new ETag), a rejected document/folder
name clash, an out-of-scope write (`PermissionDenied`), deleting it, and the
folder disappearing afterwards.
A new unit test checks that deleting a folder path sends no request; it
fails without the guard. The `404` case is covered by
`test_delete_not_existing` against RSilo. After the review changes, a local
smoke test against RSilo reports the name clash as `Conflict`.
# AI Usage Statement
- Harness: Claude Code
- Model: Claude Opus 5.5 (`claude-opus-5-5`)
- Effort: high
- Role: Ran a spike against RSilo and armadietto to find which protocol
constraints break the shared behavior suite, wrote the writer, deleter, tests,
CI and docs changes, found, reported and fixed the armadietto crash, and ran a
two-axis code review (standards and spec) through sub-agents. I reviewed the
design decisions above and am accountable for the change. Unknowns: the
armadietto recursive-delete listing failure.
--
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]