From 98871b8e84f7fe57fe6bbf0cfbb7d768bb8f626b Mon Sep 17 00:00:00 2001 From: xxhZs <1060434431@qq.com> Date: Tue, 27 Aug 2024 20:05:41 +0800 Subject: [PATCH] fix --- src/storage/hummock_sdk/src/change_log.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/storage/hummock_sdk/src/change_log.rs b/src/storage/hummock_sdk/src/change_log.rs index 885880933ce11..ec61e8c965284 100644 --- a/src/storage/hummock_sdk/src/change_log.rs +++ b/src/storage/hummock_sdk/src/change_log.rs @@ -90,9 +90,16 @@ impl TableChangeLog { &self.0[start..end] } + /// Returns epochs where value is non-null and >= `min_epoch`. pub fn get_epochs(&self, min_epoch: u64, max_count: usize) -> Vec { self.filter_epoch((min_epoch, u64::MAX)) .iter() + .filter(|epoch_change_log| { + // Filter out empty change logs + let new_value_empty = epoch_change_log.new_value.is_empty(); + let old_value_empty = epoch_change_log.old_value.is_empty(); + !new_value_empty || !old_value_empty + }) .flat_map(|epoch_change_log| epoch_change_log.epochs.iter().cloned()) .filter(|a| a >= &min_epoch) .clone()