Skip to content

Fix inability to rename resulting tar on export if /tmp is on another filesystem (tmpfs)#166

Merged
BeryJu merged 2 commits intoBeryJu:mainfrom
cubic3d-labs:fix-export-tmp-dir
Feb 26, 2023
Merged

Fix inability to rename resulting tar on export if /tmp is on another filesystem (tmpfs)#166
BeryJu merged 2 commits intoBeryJu:mainfrom
cubic3d-labs:fix-export-tmp-dir

Conversation

@cubic3d
Copy link
Contributor

@cubic3d cubic3d commented Feb 26, 2023

If the temporary directory is on a different filesystem than the one korb is called from, go's os.Rename function is unable to rename the file, because it would need to be moved (copy actual bytes) between filesystems:

WARN[0010] failed to copy file   component=strategy error="rename /tmp/korb-mover-3168494533 s3-vol.tar: invalid cross-device link" strategy=export

The above error was suppressed by not handling it.

This PR avoids using a potential tmpfs, because of it's possible size restrictions and the requirement to move the resulting file, replaces the deprecated ioutil.TempFile function and enabled error handling on renaming.

@BeryJu BeryJu merged commit 4aae63a into BeryJu:main Feb 26, 2023
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.

2 participants