Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(server): make file movement more resilient #4361

Merged
merged 1 commit into from
Oct 11, 2023

Conversation

danieldietzler
Copy link
Member

@danieldietzler danieldietzler commented Oct 5, 2023

Closes #2877

Instead of moving a file, updating the database, and trying to undo the move on failure, this PR changes the process to instead persist pending move information to the database, making the process more resilient to failures.

The pending move table contains unique key constraints that act as file and entity level locks.

@vercel
Copy link

vercel bot commented Oct 5, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
immich ❌ Failed (Inspect) Oct 10, 2023 8:50pm

@bo0tzz
Copy link
Member

bo0tzz commented Oct 5, 2023

Closes #2877

@bo0tzz bo0tzz linked an issue Oct 5, 2023 that may be closed by this pull request
3 tasks
@danieldietzler danieldietzler force-pushed the chore/better-file-moving branch 2 times, most recently from 8453031 to ea86443 Compare October 5, 2023 20:05
@danieldietzler danieldietzler force-pushed the chore/better-file-moving branch from 4cc0c7d to e250b4a Compare October 7, 2023 11:25
@danieldietzler danieldietzler marked this pull request as ready for review October 7, 2023 11:30
@danieldietzler danieldietzler changed the title chore(server): make file movement more resilient refactor(server): make file movement more resilient Oct 7, 2023
@danieldietzler danieldietzler requested a review from jrasm91 October 9, 2023 09:47
@jrasm91 jrasm91 force-pushed the chore/better-file-moving branch from e3d17a6 to d05b410 Compare October 9, 2023 17:27
@jrasm91 jrasm91 force-pushed the chore/better-file-moving branch from d05b410 to 9eb15a0 Compare October 10, 2023 17:01
@danieldietzler danieldietzler force-pushed the chore/better-file-moving branch 5 times, most recently from 8fa5e80 to c50859f Compare October 10, 2023 18:26
@jrasm91 jrasm91 force-pushed the chore/better-file-moving branch from c50859f to 414e1bd Compare October 10, 2023 20:45
@jrasm91 jrasm91 force-pushed the chore/better-file-moving branch from 414e1bd to 083b69b Compare October 10, 2023 20:48
@alextran1502
Copy link
Contributor

Amazing work, thanks all for this PR

@alextran1502 alextran1502 merged commit 09bf1c9 into main Oct 11, 2023
@alextran1502 alextran1502 deleted the chore/better-file-moving branch October 11, 2023 02:14
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.

[BUG] assets may become orphaned when moved by the storage template service
5 participants