clean up is_ancient in is_candidate_for_shrink (#31616)

clean up `is_ancient` in `is_candidate_for_shrink`
This commit is contained in:
Jeff Washington (jwash) 2023-05-15 16:05:41 -05:00 committed by GitHub
parent 6172b0d50c
commit eaaed0a726
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -7933,7 +7933,11 @@ impl AccountsDb {
store: &Arc<AccountStorageEntry>,
allow_shrink_ancient: bool,
) -> bool {
let total_bytes = if is_ancient(&store.accounts) {
// appended ancient append vecs should not be shrunk by the normal shrink codepath.
// It is not possible to identify ancient append vecs when we pack, so no check for ancient when we are not appending.
let total_bytes = if self.create_ancient_storage == CreateAncientStorage::Append
&& is_ancient(&store.accounts)
{
if !allow_shrink_ancient {
return false;
}