Skip to content

Commit

Permalink
rebasing fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
xiangzhu70 committed Jan 19, 2023
1 parent 7016595 commit aa74ca6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion ledger-tool/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1093,7 +1093,7 @@ fn load_bank_forks(
};

// For all account_paths, set up the run/ and snapshot/ sub directories.
let account_run_paths = account_paths.into_iter().map(
let account_run_paths: Vec<PathBuf> = account_paths.into_iter().map(
|account_path| {
match setup_accounts_run_and_snapshot_paths(&account_path) {
Ok(account_run_path) => account_run_path,
Expand Down
12 changes: 7 additions & 5 deletions runtime/src/accounts_background_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
mod stats;
use {
crate::{
accounts_db::{CalcAccountsHashDataSource, SnapshotStoragesOne},
accounts_db::{AccountStorageEntry, CalcAccountsHashDataSource},
accounts_hash::CalcAccountsHashConfig,
bank::{Bank, BankSlotDelta, DropCallback},
bank_forks::BankForks,
Expand Down Expand Up @@ -141,14 +141,16 @@ pub struct SnapshotRequestHandler {
pub accounts_package_sender: Sender<AccountsPackage>,
}

type AccountStorages = Vec<Arc<AccountStorageEntry>>;

impl SnapshotRequestHandler {
// Returns the latest requested snapshot slot, if one exists
pub fn handle_snapshot_requests(
&self,
test_hash_calculation: bool,
non_snapshot_time_us: u128,
last_full_snapshot_slot: &mut Option<Slot>,
) -> Option<Result<(u64, SnapshotStoragesOne), SnapshotError>> {
) -> Option<Result<(u64, AccountStorages), SnapshotError>> {
let (
snapshot_request,
accounts_package_type,
Expand Down Expand Up @@ -265,7 +267,7 @@ impl SnapshotRequestHandler {
last_full_snapshot_slot: &mut Option<Slot>,
snapshot_request: SnapshotRequest,
accounts_package_type: AccountsPackageType,
) -> Result<(u64, SnapshotStoragesOne), SnapshotError> {
) -> Result<(u64, AccountStorages), SnapshotError> {
debug!(
"handling snapshot request: {:?}, {:?}",
snapshot_request, accounts_package_type
Expand Down Expand Up @@ -506,7 +508,7 @@ impl AbsRequestHandlers {
test_hash_calculation: bool,
non_snapshot_time_us: u128,
last_full_snapshot_slot: &mut Option<Slot>,
) -> Option<Result<(u64, SnapshotStoragesOne), SnapshotError>> {
) -> Option<Result<(u64, AccountStorages), SnapshotError>> {
self.snapshot_request_handler.handle_snapshot_requests(
test_hash_calculation,
non_snapshot_time_us,
Expand Down Expand Up @@ -538,7 +540,7 @@ impl AccountsBackgroundService {
.spawn(move || {
let mut stats = StatsManager::new();
let mut last_snapshot_end_time = None;
let mut _last_snapshot_storages: Option<SnapshotStoragesOne> = None;
let mut _last_snapshot_storages: Option<AccountStorages> = None;
loop {
if exit.load(Ordering::Relaxed) {
break;
Expand Down
2 changes: 1 addition & 1 deletion runtime/src/snapshot_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -891,7 +891,7 @@ fn get_snapshot_accounts_hardlink_dir(
fn hard_link_storages_to_snapshot(
bank_snapshot_dir: impl AsRef<Path>,
bank_slot: u64,
snapshot_storages: &[SnapshotStorageOne],
snapshot_storages: &[Arc<AccountStorageEntry>],
) -> Result<()> {
let accounts_hardlinks_dir = bank_snapshot_dir.as_ref().join("accounts_hardlinks");
fs::create_dir_all(&accounts_hardlinks_dir)?;
Expand Down

0 comments on commit aa74ca6

Please sign in to comment.