Repository navigation
Merge Workpackages back to main - #957
Merged
Merged
Conversation
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]>
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]>
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]>
…l delete rollback Backport-of: 6bee925
port upload driver contract: PrepareUpload, RollbackUpload, scan results
Signed-off-by: Christian Richter <[email protected]>
Brings the ListFolder permissions race fix, the WWW-Authenticate realm escaping, the async propagator deprecation and the go-playground/locales bump into workpackages. Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
merge main into workpackages
Fix Tree.Delete rollback to remove stale trash symlinks and restore renamed nodes when deletion fails.
Port of owncloud#692, adapted to our diverged decomposedfs copies: - Add an Orphaned upload session filter to storage.UploadSessionFilter, evaluated last in ListUploadSessions of both copies because it reads the node metadata of every session. - Add IsOrphaned and syntheticNode to OcisSession and DecomposedFsSession. - Extract the node reverting from upload.Cleanup into revertNode and run it before the bin and info files are removed, so a failure leaves a recoverable session instead of a deleted one. The readable-node branch keeps our local RevertUpload/Purge logic (upstream has RevertCurrentRevision). When the node metadata is unreadable, revert the optimistic size propagation from a node built out of the session's SpaceID/NodeID/NodeParentID and remove the orphaned node, so the space quota is released; the upload is kept when the quota cannot be released. In the pkg fork the orphaned node is removed via lu.PurgeNode and its metadata via the MetadataNode-based backend Purge. - Clean up orphaned sessions on PostprocessingFinished instead of returning early and leaving them to be retried forever. - Add the regression test to both upload_async_test.go copies. Changelog is maintained in the ready-release-go PR, not per commit. Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
- Add node.ErrMissingParentID and treat a session as orphaned only when reading its node fails with it. Other read errors, e.g. an unavailable cache, are logged and leave the session untouched. - On PostprocessingFinished, only drop the bytes and info of an orphaned session when postprocessing asked to delete the upload. - Clear and persist the session's sizeDiff before reverting it, so a repeated cleanup does not release the quota twice. - Remove the bytes even if reverting the node failed, so infected files do not stay on disk. Only the info is kept for a retry. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
Cleaning up an orphaned upload removed the node without checking whether the upload created it. For an upload that overwrites a file the node holds the previous version, on posix the user's file itself, so it got deleted. We now only revert the size diff for an existing node. A node the upload created is removed only while it is still empty: the uploaded bytes only get there when the upload is finalized. If it has content, something outside of us wrote it, e.g. an editor saving atomically on posix before the watcher assimilated the file, so we keep it. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
fix(decomposedfs): release the quota of orphaned upload sessions
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]>
feat(upload): add driver independent upload sessions
TouchFile only returns an error here, so the coordinator reads the touched node back to learn its id and space owner or manager.
A space manager share could get an expiration even when it was the last permanent manager of the space. Once it expired the space was left without a manager. The last manager check in UpdateShare only ran when the new permissions stripped AddGrant or RemoveGrant. We now also run it when the share keeps the manager permissions but ends up with an expiration, either from the update or because it already had one and only the permissions change. Removing an expiration does not need the check. Upstream did this in the gateway, where space grants were still handled at the time (`owncloud#631`). Our space membership lives in the share provider since #593, so the check goes into UpdateShare next to the existing one, which ignores expiring managers since #990. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
A space share could carry a single grant management bit, e.g. viewer permissions plus RemoveGrant. decomposedfs treated RemoveGrant alone as the manager marker, so such a grantee could manage the space while the UI showed a viewer. The share provider now rejects space root shares that carry any of AddGrant, UpdateGrant, RemoveGrant or DenyGrant without the full manager permissions, both on create and on update. In decomposedfs IsManager, IsEditor and IsViewer become IsSpaceManager, IsSpaceEditor and IsSpaceViewer and check the role bitmaps instead of a single bit. A space manager needs AddGrant, UpdateGrant and RemoveGrant. DenyGrant is not required, so older manager and coowner grants still count. Upstream put the share check into the gateway (`owncloud#653`). Space membership lives in the share provider since #593, so the check goes into CreateShare and UpdateShare there. Update requests are checked against the effective new permissions, the same ones the last manager check uses. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
usershareprovider: tighten space manager checks
Resolve the usershareprovider.go conflict in favour of #993, which landed the same last manager expiration check first. Its mayRemoveLastPermanentManager is the more precise variant: it resolves the permissions and expiration an update leaves on the share, so only expiring managers trigger the check. Drop this branch's specs that #993 covers with the same or stronger scenarios and keep the one it lacks: an expiration in the payload is ignored when the update mask does not list it. Co-authored-by: Copilot <[email protected]>
Advertise spaces.server_managed in the capabilities and let service accounts update and list grants, so the server can manage space membership automatically. Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
fix(usershareprovider): prevent setting an expiration on the last space manager
The ERR_ALREADY_EXISTS prefix dropped the space between "already exists:" and the detail, so every AlreadyExists message changed from "error: already exists: foo" to "error: already exists:foo". We now append the space in Error() and keep the prefix without it, so strings.Contains checks on the prefix still match. Also add specs for ListPublicShares: an AlreadyExists error from the share manager (the metadata space exists but the service user cannot see it) yields an OK response with no shares, other errors stay an internal error carrying the error message. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
feat(spaces): allow managing spaces through the server
fix(publicshareprovider): do not fail listing public shares when the metadata space is not accessible
Brings the typed storage results (#986), the stuck synchronous upload fix (#976), the main-queue replica fix (#984), the posix id cache fail fast (#989) and release 2.52.2 into workpackages. The typed results were mostly mechanical: the ocm received driver keeps its service account client, nextcloud keeps its real TouchFile (now returning a TouchFileResult), and the coordinator ignores the TouchFile result and still reads the node back, because not every driver fills it. #976 patched the legacy upload session store, which workpackages removed. Its recovery of nodes left processing by an interrupted synchronous upload moves into the pkg fork as Decomposedfs.recoverInterruptedUpload. The coordinator stages sessions in the same <upload dir>/<id> and <id>.info layout as the old store, so nodes stuck by older versions still heal on the first download. Aspects.DisableVersioning stays gone, SeparateBlobs comes along. The sync specs now drive uploads through the coordinator. The two blob-first specs follow with the next commit, which moves the blob-first write to the coordinator path. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
The coordinator finished inline uploads in three steps: PrepareUpload pointed the node to the session's blob and marked it as processing, CommitUpload stored the blob, and MarkProcessing removed the mark. A crash in between left the mark forever, since nothing postprocesses synchronous uploads, and downloads failed with 425. This is the coordinator side of the bug #976 fixed in the legacy upload path on main. We now hand PrepareUpload the staged file (UploadInfo.Source) on the inline path. With a blobstore that keeps blobs apart from the nodes (decomposed, decomposeds3), PrepareUpload stores the blob and only then switches the node, without a mark. For an existing file that happens under the node lock, after the etag and quota checks. For a new file the blob is stored before the node exists, like main does: a crash while writing must not leave a node without metadata that blocks the name. PrepareUpload reports Committed, so the coordinator skips CommitUpload and MarkProcessing. Posix and the other drivers ignore Source and keep the old flow. A mark left by an interrupted upload is cleared in the same write, by emptying it. Only a processing mark counts as an upload superseding the node now, an empty one would make every later upload take a snapshot. The revisions kept only for a rollback go away like after a live commit, but not before the size was propagated: until then the rollback still needs them and their blobs. If the blob cannot be stored, PrepareUpload wraps storage.ErrSourceNotStored and the coordinator keeps the session as failed, like after a failed CommitUpload: the staged bytes are the only copy of the upload and the failure may be transient. If writing the node fails, PrepareUpload puts the old metadata back. The new blob is still kept, because the failed write might have switched the node anyway, so the spec from main now expects the old content plus a leftover blob. Assisted-by: Claude Code:claude-fable-5-2 Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
chore: merge main into workpackages
butonic
marked this pull request as ready for review
November 13, 2026 14:26
micbar
approved these changes
Nov 13, 2026
micbar
left a comment
Member
There was a problem hiding this comment.
These PRs have already been reviewed.
butonic
added a commit
to opencloud-eu/opencloud
that referenced
this pull request
Nov 13, 2026
workpackages was merged into reva main with opencloud-eu/reva#957, so we no longer need to pin the workpackages branch. The code is the same as 7ff1d6fb1, only the version changes. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
6 of 14 tasks
1 task
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.
Brings the workpackages branch back into main. Most of it is the upload coordinator: the storage drivers no longer run uploads themselves.
Upload coordinator (#906, #934, #935, #936, #937, #949, #978, #1001)
pkg/uploadreceives the bytes for PUT and TUS, stages them in<upload dir>/<id>+<id>.info, verifies checksums, checks quota and locks, and either finishes the upload right away or hands it to postprocessing.PrepareUpload(write the node metadata before postprocessing),CommitUpload(write the bytes) andRollbackUpload.InitiateUpload,Upload,ListUploadSessions, the per driver session stores and the tus data store methods are gone (~5800 lines), including the legacypkg/storage/pkg/decomposedfs/uploadstore and theDisableVersioningaspect.recoverInterruptedUpload).upload_directoryon the storageprovider and dataprovider services (needed for drivers without a local root), plusasyncfileuploads,mount_idandevents.{numconsumers,consumer_group,commit_max_retries,commit_retry_backoff}read from the driver config by the coordinator.Storage capabilities (#932)
storage.CapabilityProvider), and the OCS capabilities report it per provider. Drivers without a declaration keep the old behaviour.Space membership (#990, #992, #993, #994)
spaces.server_managedcapability (defaultfalse), and service accounts may update and list grants, so the server can manage space membership.Smaller fixes
Tree.Deleterolls back cleanly when a delete fails (Fix Tree.Delete rollback to remove stale trash symlinks and restore renamed nodes when deletion fails. #927).Breaking for anything implementing
storage.FSoutside this repo:InitiateUploadandUploadare replaced byPrepareUploadandRollbackUpload, andComposableFSis gone. The opencloud bump needs the coordinator wiring from opencloud-eu/opencloud#3839, which already runs this branch through the opencloud CI.Known open issues, not addressed here:
upload_directoryReview focus:
pkg/upload/coordinator.go: the finish paths (inline, async, rollback) and what happens to the staged session on each failure.pkg/storage/pkg/decomposedfs/prepare_upload.goandcommit_upload.go: the order of blob write, node switch, revisions and propagation.PrepareUploadwrites the new metadata onto the live node before postprocessing, and revisions are still created viaCreateRevision.Each part was reviewed in its own PR, linked above; reviewing per PR is easier than reviewing the diff.
Assisted by Claude Code (claude-opus-5-5): it collected the changes from the merged PRs and wrote this description.