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

Snapshot Package: Incorrect usage of hard links #5448

Closed
t-nelson opened this issue Aug 7, 2019 · 2 comments

Comments

@t-nelson
Copy link
Contributor

commented Aug 7, 2019

Problem

[2019-08-06T15:08:25.988279757Z INFO solana::snapshot_package] Error from package_snapshots: IO(Os { code: 18, kind: Other, message: "Invalid cross-device link" })

I noticed several of these in the bootstrap leader's logs from TdS stage 1 dryrun 2 today. The snapshot packaging services uses hard links to point snapshot archives from the temp path they were created in, to the output directory they are expected to be served from. Hard links are limited to a single filesystem (see EXDEV error code in man 2 link) and there for the temp dir and output dir can't cross filesystem boundaries.

Proposed Solution

fs::hard_link(&temp_tar_path, &snapshot_package.tar_output_file)?;

Verify that snapshot temp and output directories reside on the same filesystem or use symlinks. We're probably going to run into portability considerations either way

cc: @carllin

@carllin

This comment has been minimized.

Copy link
Contributor

commented Aug 7, 2019

Ah good catch! I think the fix here is to make a temp file for the archive within the output directory, then rename it. That way we don't cross filesystem boundaries.

@mvines mvines added this to the Mavericks v0.18.0 milestone Aug 7, 2019

@mvines mvines added this to To do in TdS Stage 0 via automation Aug 7, 2019

@t-nelson

This comment has been minimized.

Copy link
Contributor Author

commented Aug 7, 2019

That'd work! Maybe even easier would be to write to a temp filename in the output dir, then just rename it once the snapshot is finalized.

@mvines mvines moved this from To do to In progress in TdS Stage 0 Aug 7, 2019

@carllin carllin closed this Aug 7, 2019

TdS Stage 0 automation moved this from In progress to Done Aug 7, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
3 participants
You can’t perform that action at this time.