Skip to content

fix(decomposedfs): create a new file in one write in PrepareUpload - #944

Merged
butonic merged 3 commits into
port-662from
port-756
Nov 4, 2026
Merged

butonic merged 3 commits into
port-662from
port-756

Conversation

@butonic

@butonic butonic commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

Part of the upload coordinator stack, see #934.

PrepareUpload now creates a new file's node under the id handed out at initiate, together with the processing mark, in one attribute batch. There is no window any more where the node exists without the mark.

It also handles overlapping uploads to the same file: the older one survives whatever happens to the newer one (commit, rollback), also with versioning disabled. On posix that includes the content. A revision a newer upload commits into keeps its own metadata.

This is the biggest PR of the stack.

Review focus:

  • prepare_upload.go (pkg fork): the new-file path and the snapshot taken for an existing file
  • commit_upload.go and posix tree.go: restoring a superseded upload on rollback, with and without versioning
  • posix revisions: posix copies the content into the revision, decomposedfs only the metadata
  • posix_superseded_upload_test.go describes the scenarios

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

stacked on #943

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-756 branch 3 times, most recently from 21e49a8 to 532c942 Compare October 30, 2026 10:44
@butonic
butonic force-pushed the port-756 branch 2 times, most recently from fdba4bc to f1e2e77 Compare November 3, 2026 15:19
@butonic butonic changed the title port creating a new file in one write in PrepareUpload fix(decomposedfs): create a new file in one write in PrepareUpload Nov 3, 2026
@butonic
butonic force-pushed the port-756 branch 4 times, most recently from 31842e0 to 80dd61c Compare November 4, 2026 07:56
f-firas and others added 3 commits November 4, 2026 10:27
The posix changes are left to a follow-up commit, since our posix is
built on the other decomposedfs copy.
…nto it

ReadNode caches the node's attributes, not the revision's, when it
reads a revision. CommitUpload wrote the scan result onto the revision
a newer upload had kept for it, and on posix that write stored the
cached attributes: the revision then claimed the newer upload's blob
id and size. CommitUpload now drops the cache of the revision it
writes into.

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

The pkg fork's PrepareUpload creates a new file's node under the id the
coordinator minted, marks the node as processing in the same attribute
batch, reports the space owner of a new file, and purges a node it
created when it fails. Posix and the decomposedfs tree remove what
InitNewNode made when it fails; posix caches the new id only once the
name is its own, and keeps the storage path out of the AlreadyExists
error.

When two uploads to the same file overlap, the older one survives
whatever happens to the newer one, also with versioning disabled:

- PrepareUpload snapshots a node another upload is still processing,
  and records that upload's processing mark on the revision
- RollbackUpload restores the revision through the tree, so posix gets
  the content back too, and hands the mark back to the older upload
- an upload that commits into such a revision clears the mark there
- with versioning disabled, a commit to the live file drops the
  revisions that only served a rollback
- rolling back the older upload drops the revision the newer one kept
  of it

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