diff --git a/src/meta/src/hummock/manager/checkpoint.rs b/src/meta/src/hummock/manager/checkpoint.rs index 67ab7ebcf047..773ca9e6ba53 100644 --- a/src/meta/src/hummock/manager/checkpoint.rs +++ b/src/meta/src/hummock/manager/checkpoint.rs @@ -28,6 +28,7 @@ use risingwave_pb::hummock::hummock_version_checkpoint::{ }; use risingwave_pb::hummock::{PbHummockVersionArchive, PbHummockVersionCheckpoint}; use thiserror_ext::AsReport; +use tracing::warn; use crate::hummock::error::Result; use crate::hummock::manager::versioning::Versioning; @@ -159,7 +160,20 @@ impl HummockManager { summary .insert_table_infos .iter() - .map(|t| (t.object_id, t.file_size)), + .map(|t| (t.object_id, t.file_size)) + .chain( + version_delta + .change_log_delta + .values() + .flat_map(|change_log| { + let new_log = change_log.new_log.as_ref().unwrap(); + new_log + .new_value + .iter() + .chain(new_log.old_value.iter()) + .map(|t| (t.object_id, t.file_size)) + }), + ), ); } @@ -171,7 +185,12 @@ impl HummockManager { let total_file_size = removed_object_ids .iter() - .map(|t| object_sizes.get(t).copied().unwrap()) + .map(|t| { + object_sizes.get(t).copied().unwrap_or_else(|| { + warn!(object_id = t, "unable to get size of removed object id"); + 0 + }) + }) .sum::(); stale_objects.insert( current_version.id,