From eaaed0a726ce82cc097832dab988f722e12c1c1f Mon Sep 17 00:00:00 2001 From: "Jeff Washington (jwash)" Date: Mon, 15 May 2023 16:05:41 -0500 Subject: [PATCH] clean up is_ancient in is_candidate_for_shrink (#31616) clean up `is_ancient` in `is_candidate_for_shrink` --- runtime/src/accounts_db.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/runtime/src/accounts_db.rs b/runtime/src/accounts_db.rs index a271ff5bb8..61115c9928 100644 --- a/runtime/src/accounts_db.rs +++ b/runtime/src/accounts_db.rs @@ -7933,7 +7933,11 @@ impl AccountsDb { store: &Arc, 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; }