Repository navigation
port upload driver contract: PrepareUpload, RollbackUpload, scan results - #906
Merged
butonic merged 11 commits intoOct 28, 2026
Merged
Conversation
butonic
force-pushed
the
port-664-669-688-690-694
branch
from
October 23, 2026 09:28
e269ea9 to
747b180
Compare
The pkg decomposedfs fork gets PrepareUpload in the next commit.
The pkg decomposedfs fork snapshots the previous version through the tree's CreateRevision, like the legacy upload path does, so posix keeps a copy of the current content as a revision while decomposedfs only copies the metadata. On failure it removes that revision without retaking the node lock and restores the old mtime in the same batch as the other attributes. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
CommitUpload wrote the staged bytes through a bare node without a space root, which the posix blobstore rejects, and always onto the live node. On posix the content lives in the node itself, so: - commit against the real, locked node - if a newer upload took over the node, write into the revision that upload created for this session; without one (versioning disabled) discard the bytes, nothing references them - add UploadSource.Path so a staged file can be moved into place instead of copied from a reader - stage posix reader uploads in the space's .oc-tmp dir, which the watcher ignores, and don't re-stage a file that already is there Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
Hunks that conflict with our revert code (RevertUpload) keep our side; the next commit adapts RollbackUpload to it.
Both decomposedfs copies get Node.RevertLatestRevision, which restores the latest revision onto the node and removes it, without purging the node or unmarking processing. RollbackUpload uses it. Without a revision (versioning disabled) it returns PreconditionFailed and leaves the node alone instead of purging it, as the previous metadata can't be restored. Adds RollbackUpload to the pkg fork, with specs for both copies and posix. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
butonic
force-pushed
the
port-664-669-688-690-694
branch
2 times, most recently
from
October 23, 2026 10:45
d47af19 to
97e8298
Compare
Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
RollbackUpload keeps our PreconditionFailed when there is no revision to restore. The pkg decomposedfs fork gets the fixes in the next commit.
- PrepareUpload checks the quota for new files too - CommitUpload stores the scan result on the node that holds the content: the node, or the revision when a newer upload took over - RollbackUpload purges a node the upload created Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
Every driver copies options.DisableVersioning into the aspect, and only the legacy upload session store reads it; PrepareUpload reads the option. It can go when the upload coordinator replaces that store. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
butonic
force-pushed
the
port-664-669-688-690-694
branch
from
October 23, 2026 11:40
97e8298 to
d575223
Compare
The legacy decomposedfs copy stays a snapshot of the original driver, including its known flaws; our own upload behaviour lives in the pkg fork. So this undoes what the earlier commits added there: - CommitUpload takes a body only; a staged file path is for the pkg fork - RollbackUpload purges an existing node when there is no revision to restore, like upstream, instead of returning PreconditionFailed - Node.RevertCurrentRevision provides upstream's API on top of our RevertUpload; DeleteRevision is back as it was - the rollback specs are upstream's Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
Member
Author
|
we are going to collect some prs in the workpackages branch until the bugfixing phase for the production release is over |
butonic
added a commit
to butonic/reva
that referenced
this pull request
Oct 28, 2026
workpackages merged opencloud-eu#906 as e541dac, which left this branch with two merge bases (the 2.52.1 release and the opencloud-eu#906 head). git resolves that cleanly, but GitHub reports the PR as conflicting. Merging back collapses the history to a single base and brings in the guest share type for propfind (opencloud-eu#918). 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.
Ported and adapted with Claude Code (claude-opus-5-5). Each port is two commits: the upstream change with its original author, then our adaptation for the pkg decomposedfs fork and posix. Reviewing commit by commit is easiest.
Completes the storage driver side of the new upload pipeline: a driver can now prepare, commit and roll back an upload on its own. Nothing calls these methods yet; that comes with the upload coordinator. The legacy
pkg/storage/utils/decomposedfscopy gets the methods unchanged; our own behaviour is only in thepkg/storage/pkg/decomposedfsfork.PrepareUpload
Called after all bytes are received and before postprocessing. It re-checks the preconditions (If-Match, If-None-Match, If-Unmodified-Since) and the quota, snapshots the previous version, writes the new node metadata (blob id = session id, size, checksums, mtime) and propagates the size diff.
pkg/storage/pkg/decomposedfsfork snapshots through the tree'sCreateRevision, like the legacy upload path does: posix keeps a copy of the current content as a revision, decomposedfs only copies the metadata.CommitUpload
UploadSource.Pathlets a caller hand over a staged file in addition to the body: the pkg fork uses it, so posix moves the file into place instead of copying the body. Posix uploads from a reader are staged in.oc-tmp.UploadSource.ScanResult/ScanDatecarry the virus scan result. It is stored on the node, or on the revision when the upload was taken over.RollbackUpload
PreconditionFailedand leaves the node alone, because the previous metadata can't be restored. The legacypkg/storage/utils/decomposedfscopy keeps its original behaviour and purges the node.Also included
ChunkHandler.Assembleassembles chunked uploads without going through the legacy upload path.DisableVersioningaspect is marked redundant: every driver copies the option into it, and only the legacy upload session store reads it.Tests
New specs for PrepareUpload, CommitUpload and RollbackUpload in both decomposedfs copies, plus posix specs (
posix_prepare_upload_test.go) for snapshots, staged files, takeover and rollback.go test ./pkg/storage/...and golangci-lint pass. The upstream commits for PrepareUpload and RollbackUpload don't build on their own (the pkg fork gets the new methods in the commit after); every adaptation commit does.