Skip to content

Commit

Permalink
Use file_size() determine whether a tiered-storage file is ancient.
Browse files Browse the repository at this point in the history
  • Loading branch information
yhchiang-sol committed Mar 22, 2024
1 parent 684cba3 commit 51fe14a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion accounts-db/src/ancient_append_vecs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -968,7 +968,9 @@ pub const fn get_ancient_append_vec_capacity() -> u64 {
pub fn is_ancient(storage: &AccountsFile) -> bool {
match storage {
AccountsFile::AppendVec(storage) => storage.capacity() >= get_ancient_append_vec_capacity(),
AccountsFile::TieredStorage(ts) => ts.file_size() >= get_ancient_append_vec_capacity(),
AccountsFile::TieredStorage(ts) => {
ts.file_size().unwrap_or(0) >= get_ancient_append_vec_capacity()
}
}
}

Expand Down

0 comments on commit 51fe14a

Please sign in to comment.