Skip to content

fix(upload): roll back orphaned uploads through the driver - #939

Merged
butonic merged 2 commits into
port-717from
port-720
Nov 4, 2026
Merged

butonic merged 2 commits into
port-717from
port-720

Conversation

@butonic

@butonic butonic commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

Part of the upload coordinator stack, see #934.

Cleaning up an orphaned upload now rolls back its node through the driver's RollbackUpload and releases the quota, like #951 did for the legacy sessions. RollbackUpload gets the ids recorded in the session (storage.RollbackInfo), so in the pkg fork a node whose metadata can't be read any more is still rolled back.

Review focus:

  • RollbackInfo in pkg/storage/storage.go: is that enough for a driver to undo PrepareUpload without readable metadata?
  • prepare_upload.go in the pkg fork and its posix test

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

stacked on #938

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-720 branch 2 times, most recently from de0cc56 to c2a816a Compare October 30, 2026 10:16
@butonic butonic changed the title port rolling back orphaned uploads through the driver fix(upload): roll back orphaned uploads through the driver Nov 3, 2026
@butonic
butonic force-pushed the port-720 branch 4 times, most recently from 1d8c666 to 3d7d402 Compare November 4, 2026 07:56
LarsJurgensen and others added 2 commits November 4, 2026 10:27
RollbackUpload takes the RollbackInfo the coordinator records in the
session. When the node's metadata can no longer be read, the pkg fork
falls back to the recorded node and parent ids: it reverts the size
propagation and removes the node through the lookup, so posix drops
the file and its id cache entry, and decomposedfs the parent's child
entry. If the propagation fails, the node is kept so the rollback can
be retried.

Only a missing parent id counts as orphaned. Any other lookup error,
e.g. an unavailable cache, may be temporary and is returned. The node
is only removed if the upload created it and it is still empty: an
existing node holds the previous version, on posix the user's file,
and content in a new node was written by something outside of us.

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-720 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