From 2690b609ff5ed4a647099ea67a761c604bd6bd1f Mon Sep 17 00:00:00 2001 From: Li0k Date: Sat, 11 Jan 2025 02:54:49 +0800 Subject: [PATCH] fix(storage): Remove logic for deleting objects in truncate_time_travel_metadata --- src/meta/src/hummock/manager/time_travel.rs | 22 ++------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/src/meta/src/hummock/manager/time_travel.rs b/src/meta/src/hummock/manager/time_travel.rs index 721d90e860310..e9886519c0485 100644 --- a/src/meta/src/hummock/manager/time_travel.rs +++ b/src/meta/src/hummock/manager/time_travel.rs @@ -108,18 +108,8 @@ impl HummockManager { txn.commit().await?; return Ok(()); }; - let ( - latest_valid_version_id, - latest_valid_version_sst_ids, - latest_valid_version_object_ids, - ) = { - ( - latest_valid_version.id, - latest_valid_version.get_sst_ids(), - latest_valid_version.get_object_ids(), - ) - }; - let mut object_ids_to_delete: HashSet<_> = HashSet::default(); + let (latest_valid_version_id, latest_valid_version_sst_ids) = + { (latest_valid_version.id, latest_valid_version.get_sst_ids()) }; let version_ids_to_delete: Vec = hummock_time_travel_version::Entity::find() .select_only() @@ -163,8 +153,6 @@ impl HummockManager { .filter(hummock_sstable_info::Column::SstId.is_in(sst_ids_to_delete)) .exec(&txn) .await?; - let new_object_ids = delta_to_delete.newly_added_object_ids(); - object_ids_to_delete.extend(&new_object_ids - &latest_valid_version_object_ids); tracing::debug!( delta_id = delta_to_delete.id.to_u64(), "delete {} rows from hummock_sstable_info", @@ -194,8 +182,6 @@ impl HummockManager { .filter(hummock_sstable_info::Column::SstId.is_in(sst_ids_to_delete)) .exec(&txn) .await?; - let new_object_ids = prev_version.get_object_ids(); - object_ids_to_delete.extend(&new_object_ids - &latest_valid_version_object_ids); tracing::debug!( prev_version_id, "delete {} rows from hummock_sstable_info", @@ -203,10 +189,6 @@ impl HummockManager { ); next_version_sst_ids = sst_ids; } - if !object_ids_to_delete.is_empty() { - self.gc_manager - .add_may_delete_object_ids(object_ids_to_delete.into_iter()); - } let res = hummock_time_travel_version::Entity::delete_many() .filter(