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()