Skip to content

Handle cross-device file move - #4640

Merged
ruslandoga merged 5 commits into
masterfrom
file-rename-fallback
Sep 30, 2024
Merged

Handle cross-device file move#4640
ruslandoga merged 5 commits into
masterfrom
file-rename-fallback

Conversation

@ruslandoga

@ruslandoga ruslandoga commented Sep 30, 2024

Copy link
Copy Markdown
Contributor

This PR replaces File.rename! with a custom Plausible.File.mv! functions that tries File.rename! first and falls back to File.cp! and File.rm in case of EXDEV error:

EXDEV oldpath and newpath are not on the same mounted filesystem. (Linux permits a filesystem to be mounted at multiple points, but rename() does not work across different mount points, even if the same filesystem is mounted on both.)

Closes #4638


Since EE uses S3 instead of local disk for exports/imports, this PR only affects CE.

@ruslandoga ruslandoga changed the title handle cross-device file move Handle cross-device file move Sep 30, 2024
@ruslandoga
ruslandoga marked this pull request as ready for review September 30, 2024 10:28
@ruslandoga
ruslandoga requested a review from a team September 30, 2024 10:28
@ruslandoga ruslandoga added preview self-hosting Anything self-hosted labels Sep 30, 2024
@github-actions

Copy link
Copy Markdown
Preview environment👷🏼‍♀️🏗️
PR-4640

1 similar comment
@github-actions

Copy link
Copy Markdown
Preview environment👷🏼‍♀️🏗️
PR-4640

Comment thread lib/plausible/file.ex
@ruslandoga
ruslandoga added this pull request to the merge queue Sep 30, 2024
Merged via the queue into master with commit 52437e8 Sep 30, 2024
@ruslandoga
ruslandoga deleted the file-rename-fallback branch September 30, 2024 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

preview self-hosting Anything self-hosted

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CSV Import/Export does not work with mounts on different devices

3 participants