This repository has been archived by the owner on Jan 22, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Add base_slot to get_snapshot_storages() #19348
Merged
brooksprumo
merged 2 commits into
solana-labs:master
from
brooksprumo:get_snapshot_storages
Aug 20, 2021
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -483,13 +483,6 @@ impl BankRc { | |
bank_id_generator: Arc::new(AtomicU64::new(0)), | ||
} | ||
} | ||
|
||
pub fn get_snapshot_storages(&self, slot: Slot) -> SnapshotStorages { | ||
self.accounts | ||
.accounts_db | ||
.get_snapshot_storages(slot, None) | ||
.0 | ||
} | ||
Comment on lines
-487
to
-492
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This function is never called, except by |
||
} | ||
|
||
#[derive(Default, Debug, AbiExample)] | ||
|
@@ -4904,8 +4897,12 @@ impl Bank { | |
) | ||
} | ||
|
||
pub fn get_snapshot_storages(&self) -> SnapshotStorages { | ||
self.rc.get_snapshot_storages(self.slot()) | ||
pub fn get_snapshot_storages(&self, base_slot: Option<Slot>) -> SnapshotStorages { | ||
self.rc | ||
.accounts | ||
.accounts_db | ||
.get_snapshot_storages(self.slot(), base_slot, None) | ||
.0 | ||
} | ||
|
||
#[must_use] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1541,7 +1541,7 @@ pub fn snapshot_bank( | |
archive_format: &ArchiveFormat, | ||
hash_for_testing: Option<Hash>, | ||
) -> Result<()> { | ||
let storages = root_bank.get_snapshot_storages(); | ||
let storages = root_bank.get_snapshot_storages(None); | ||
let mut add_snapshot_time = Measure::start("add-snapshot-ms"); | ||
add_bank_snapshot(snapshots_dir, root_bank, &storages, snapshot_version)?; | ||
add_snapshot_time.stop(); | ||
|
@@ -1592,7 +1592,7 @@ pub fn bank_to_full_snapshot_archive( | |
bank.rehash(); // Bank accounts may have been manually modified by the caller | ||
|
||
let temp_dir = tempfile::tempdir_in(snapshots_dir)?; | ||
let storages = bank.get_snapshot_storages(); | ||
let storages = bank.get_snapshot_storages(None); | ||
let bank_snapshot_info = add_bank_snapshot(&temp_dir, bank, &storages, snapshot_version)?; | ||
|
||
package_process_and_archive_full_snapshot( | ||
|
@@ -1636,7 +1636,7 @@ pub fn bank_to_incremental_snapshot_archive( | |
|
||
let temp_dir = tempfile::tempdir_in(snapshots_dir)?; | ||
let storages = { | ||
let mut storages = bank.get_snapshot_storages(); | ||
let mut storages = bank.get_snapshot_storages(Some(full_snapshot_slot)); | ||
filter_snapshot_storages_for_incremental_snapshot(&mut storages, full_snapshot_slot); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The call to |
||
storages | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The call to
filter_snapshot_storages_for_incremental_snapshot()
will be removed in the next PR (#19349). I am trying to keep PRs as minimal as possible :)