Repository navigation
feat(upload): add driver independent upload sessions - #934
Merged
Merged
Conversation
This was referenced Oct 29, 2026
butonic
force-pushed
the
port-703
branch
3 times, most recently
from
October 30, 2026 10:44
141fa49 to
ac2b3fe
Compare
dragonchaser
approved these changes
Nov 3, 2026
This was referenced Nov 3, 2026
Upload sessions carry an explicit status (uploading, processing, failed) with a message, as the decomposedfs sessions do. Listing uploads shows it, and IsProcessing reports the processing status instead of guessing from the offset and the scan result. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
… gateway OpenCloud signs data URLs in the proxy, at the edge, so its storages configure only the download endpoint. The session then signed a token against an empty data gateway endpoint, and postprocessing got a bare "/<token>" it could not download the staged bytes from: the virus scan never ran. Return the data server URL itself in that case, as the driver sessions did. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
The decomposedfs upload sessions synced every chunk right away, so an upload could be resumed after a crash and slow disks were spared one large flush at the end of the upload. Do the same in the coordinator's sessions, and log failed chunk writes as they did. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
staticcheck S1016 flags the struct literal: both types have the same fields, so a plain conversion does the job. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First PR of the upload coordinator stack. The goal: the storage drivers no longer run uploads themselves. A coordinator in
pkg/uploadreceives the bytes (PUT and TUS), stages them, runs postprocessing and only then calls the driver:PrepareUploadbefore postprocessing,CommitUploadto write the bytes,RollbackUploadwhen it fails. The stack builds this up step by step and ends with removing the per-driver upload code in #949.This PR adds the session part:
pkg/uploadsessions stage the bytes in a shared upload directory, persist the session and sign the data URL. Sessions carry a status (uploading, processing, failed) with a message, like the decomposedfs sessions did. Without a data gateway the session hands out the plain data server URL, because OpenCloud signs data URLs in the proxy and postprocessing (antivirus) could not download the bytes otherwise. Each staged chunk is synced to disk. Nothing uses the sessions yet.Review focus:
session.go: the persisted session format and the status transitions, this is what the later PRs build onfilestore.go: the upload dir has to be on a shared filesystem when several pods serve a spaceReview commit by commit: the first commit is the generic change, the following ones adapt the pkg decomposedfs fork and posix.
stacked on #951
Assisted by Claude Code (claude-opus-5-5): it adapted the changes, split them into this stack and wrote this description.