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

Add run parent directory for accounts files #29794

Merged
merged 11 commits into from
Jan 25, 2023

Conversation

xiangzhu70
Copy link
Contributor

@xiangzhu70 xiangzhu70 commented Jan 20, 2023

Problem

To allow hardlinking accounts files into snapshot directories (PR 29496), the first step is to generate run/ and snapshot directories for all the user provided account_paths.

This is a split of the PRs #29496 and #28745

Summary of Changes

Add the setup_accounts_run_and_snapshot_paths function;
Add the generate_test_tmp_account_path function to be used for the tests;
Many other small changes to call the setup function to initialize the account paths.

Fixes #

@xiangzhu70 xiangzhu70 marked this pull request as ready for review January 20, 2023 04:28
@brooksprumo brooksprumo self-requested a review January 20, 2023 20:00
runtime/src/snapshot_utils.rs Outdated Show resolved Hide resolved
runtime/src/snapshot_utils.rs Outdated Show resolved Hide resolved
runtime/src/snapshot_utils.rs Outdated Show resolved Hide resolved
runtime/src/snapshot_utils.rs Outdated Show resolved Hide resolved
validator/src/main.rs Outdated Show resolved Hide resolved
runtime/src/hardened_unpack.rs Show resolved Hide resolved
runtime/src/accounts_db.rs Outdated Show resolved Hide resolved
runtime/src/accounts_db.rs Outdated Show resolved Hide resolved
ledger-tool/src/main.rs Outdated Show resolved Hide resolved
core/tests/snapshots.rs Show resolved Hide resolved
@brooksprumo brooksprumo self-requested a review January 23, 2023 22:13
Copy link
Contributor

@apfitzge apfitzge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few minor things. Last thing I think should be fixed is the inner result unwrapping @brooksprumo highlighted (I also commented)

core/tests/snapshots.rs Outdated Show resolved Hide resolved
runtime/src/hardened_unpack.rs Outdated Show resolved Hide resolved
runtime/src/snapshot_utils.rs Outdated Show resolved Hide resolved
runtime/src/accounts_db.rs Outdated Show resolved Hide resolved
@brooksprumo brooksprumo self-requested a review January 24, 2023 03:24
@xiangzhu70 xiangzhu70 force-pushed the account_path_add_run_parent branch from 4b7aa8a to d69b9b6 Compare January 24, 2023 18:30
@brooksprumo brooksprumo self-requested a review January 24, 2023 18:39
Copy link
Contributor

@brooksprumo brooksprumo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good! Please re-request review once CI completes and I'll make a final pass.

Copy link
Contributor

@brooksprumo brooksprumo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

let deserialized_bank = snapshot_utils::bank_from_snapshot_archives(
&[accounts_dir.path().to_path_buf()],
&[accounts_dir.as_path().to_path_buf()],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this accounts_dir could be used directly:

Suggested change
&[accounts_dir.as_path().to_path_buf()],
&[accounts_dir],

To not block this PR, can you address this in a subsequent PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good. I will do this in a subsequent PR. Thanks!

Copy link
Contributor

@apfitzge apfitzge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

.map(|temp_dir| {
create_accounts_run_and_snapshot_dirs(temp_dir).map(|(run_dir, _snapshot_dir)| run_dir)
})
.collect();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting, I wasn't aware you could collect into a result like this! Neat!

@behzadnouri
Copy link
Contributor

@xiangzhu70 This is causing OOM on master.
Can you plz revert this commit.

xiangzhu70 added a commit to xiangzhu70/solana that referenced this pull request Jan 25, 2023
This PR is causing OOM on master.  Reverting it for now.

This reverts commit 74f89d1.
xiangzhu70 added a commit that referenced this pull request Jan 25, 2023
This PR is causing OOM on master.  Reverting it for now.

This reverts commit 74f89d1.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants