Skip to content

feat(storageprovider): hand uploads to the upload coordinator - #947

Merged
butonic merged 5 commits into
port-695-696from
port-721
Nov 4, 2026
Merged

butonic merged 5 commits into
port-695-696from
port-721

Conversation

@butonic

@butonic butonic commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

Part of the upload coordinator stack, see #934.

This is the switch: the storageprovider and dataprovider now hand uploads to the coordinator instead of the driver. The drivers only keep a DeleteRevision consumer, in the "dcfs-revisions" group. The coordinator takes the "dcfs" group.

Also:

  • the pkg fork's async upload specs drive uploads through the coordinator
  • with versioning disabled, only the snapshots kept for a rollback are removed on commit, older versions stay
  • tus sends Oc-Fileid for a new file the driver created at prepare (COPY needs it)
  • the nextcloud mock and the OCM share integration fixtures follow the coordinator (shared upload directory, service account, Upload-Length)

Review focus:

  • storageprovider.go / dataprovider.go: how the coordinator is configured and that every upload path goes through it
  • the event consumer groups: the coordinator and the drivers' DeleteRevision consumer must not steal each other's events
  • datatx/manager/tus/tus.go

Review commit by commit: the first commit is the generic change, the following ones adapt the pkg decomposedfs fork and posix.

stacked on #946

Assisted by Claude Code (claude-opus-5-5): it adapted the changes, split them into this stack and wrote this description.

@butonic
butonic added this pull request to stack #950 October 29, 2026 14:05
@butonic butonic added the Type:Maintenance E.g. technical debt, packaging, etc. label Oct 29, 2026
@butonic
butonic removed this pull request from stack #950 October 29, 2026 14:19
@butonic
butonic added this pull request to stack #952 October 29, 2026 14:19
@butonic
butonic force-pushed the port-721 branch 3 times, most recently from 5e56fa5 to b7f20af Compare October 30, 2026 10:44
@butonic butonic changed the title port wiring the storageprovider to the upload coordinator feat(storageprovider): hand uploads to the upload coordinator Nov 3, 2026
@butonic
butonic force-pushed the port-721 branch 4 times, most recently from 56dfc8b to a7647bd Compare November 4, 2026 07:56
LarsJurgensen and others added 5 commits November 4, 2026 10:27
…the driver

Decomposedfs keeps consuming only the DeleteRevision event, in a
consumer group of its own ("dcfs-revisions"), since the coordinator
takes the "dcfs" group. The tus handler still resolves a finished
upload through the driver for the etag and permission headers.
…g fork

The pkg fork no longer consumes postprocessing events. Like the legacy
copy it only keeps a DeleteRevision consumer in the "dcfs-revisions"
group, since the coordinator takes the "dcfs" group.

- the coordinator resolves a finished tus upload for the etag and
  permission headers, so this keeps working once the drivers drop their
  session stores
- the coordinator passes the staged file's path to CommitUpload, so
  posix can move it into place instead of copying it
- pkg/upload uses go-viper/mapstructure like the rest of the repo

The async upload specs of the pkg fork now drive uploads through the
coordinator against the real driver. When the newer of two overlapping
uploads is rolled back, the file is handed back to the older one, and
when both fail, the file the older one created is removed and its
quota released. For that, rolling back an upload that created the file
while a newer one is processing marks the revision the newer upload
kept, so its rollback purges the file; a commit removes such
revisions. With versioning disabled, a live commit also removes the
snapshots an overlapping upload kept for a rollback, but keeps the
versions created before versioning was disabled.

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
The header was left out for new files, because their id used to be
decided by the commit. A driver whose PrepareUpload creates the node
does so under the id minted at initiate, so that id is the file's, and
COPY, which reads the id from the upload response, needs it.

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
… mock

The coordinator reads the node it touched back without metadata keys, so
the request carries "mdKeys":null.

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
The coordinator stages uploads in an upload directory, which the
ocmreceived driver cannot derive, and commits them as the service
account, so the cesnet storage and data providers share an upload
directory and get a service account.

UploadGateway announces the upload length like ocdav does: without it the
coordinator takes the upload as empty and finishes it at initiate.

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
@butonic
butonic merged commit 1168881 into workpackages Nov 4, 2026
19 checks passed
@butonic
butonic deleted the port-721 branch November 4, 2026 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type:Maintenance E.g. technical debt, packaging, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants