Skip to content

Fix Tree.Delete rollback to remove stale trash symlinks and restore renamed nodes when deletion fails. - #927

Merged
butonic merged 2 commits into
opencloud-eu:workpackagesfrom
dragonchaser:backport-wp1-734
Nov 3, 2026
Merged

butonic merged 2 commits into
opencloud-eu:workpackagesfrom
dragonchaser:backport-wp1-734

Conversation

@dragonchaser

Copy link
Copy Markdown
Member

Fix Tree.Delete rollback to remove stale trash symlinks and restore renamed nodes when deletion fails.

@dragonchaser dragonchaser changed the title fix(decomposedfs): [OCISDEV-817] remove stale trash symlink on partia… Fix Tree.Delete rollback to remove stale trash symlinks and restore renamed nodes when deletion fails. Oct 28, 2026
@dragonchaser
dragonchaser changed the base branch from main to workpackages October 28, 2026 09:18
Signed-off-by: Christian Richter <[email protected]>
@dragonchaser
dragonchaser marked this pull request as ready for review October 29, 2026 11:43
@dragonchaser
dragonchaser requested a review from butonic November 3, 2026 14:02
@butonic
butonic merged commit a31b928 into opencloud-eu:workpackages Nov 3, 2026
19 checks passed
@dragonchaser
dragonchaser deleted the backport-wp1-734 branch November 4, 2026 07:25
butonic added a commit that referenced this pull request Nov 5, 2026
When Tree.Delete failed after creating the trash symlink, the symlink
stayed behind and pointed at a node that was never moved, and a failed
removal of the parent entry left the node renamed to its trash name.
#927 fixed this in
pkg/storage/utils/decomposedfs only, which main has since deleted, so
the decomposed and decomposeds3 drivers still had the bug.

We now remove the trash symlink on every failure path and, when the
parent entry cannot be removed, rename the node and its metadata back.

The os.Rename spec uses a 239 character node id instead of 248: the
messagepack backend writes ".<name>.mpk<int64>" temp files, which have
to stay within NAME_MAX while the trash name must not.

related: #927

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants