Skip to content

Commit

Permalink
fix(storage): Remove logic for deleting objects in truncate_time_trav…
Browse files Browse the repository at this point in the history
…el_metadata
  • Loading branch information
Li0k committed Jan 10, 2025
1 parent 340a167 commit 2690b60
Showing 1 changed file with 2 additions and 20 deletions.
22 changes: 2 additions & 20 deletions src/meta/src/hummock/manager/time_travel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<risingwave_meta_model::HummockVersionId> =
hummock_time_travel_version::Entity::find()
.select_only()
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -194,19 +182,13 @@ 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",
res.rows_affected
);
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(
Expand Down

0 comments on commit 2690b60

Please sign in to comment.