From 8766b07d6709de7de3e542f2c65d7cedc9c84a2e Mon Sep 17 00:00:00 2001 From: Little-Wallace Date: Tue, 28 Nov 2023 21:09:37 +0800 Subject: [PATCH] fix equal check Signed-off-by: Little-Wallace --- src/storage/src/hummock/sstable/builder.rs | 4 ++-- .../src/hummock/sstable/delete_range_aggregator.rs | 10 ++-------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/storage/src/hummock/sstable/builder.rs b/src/storage/src/hummock/sstable/builder.rs index 6882ba187b30..19ee26bd978c 100644 --- a/src/storage/src/hummock/sstable/builder.rs +++ b/src/storage/src/hummock/sstable/builder.rs @@ -398,7 +398,7 @@ impl SstableBuilder { assert!(self.monotonic_deletes.is_empty() || self.monotonic_deletes.len() > 1); if let Some(monotonic_delete) = self.monotonic_deletes.last() { - assert_eq!(monotonic_delete.new_epoch, HummockEpoch::MAX); + assert!(monotonic_delete.new_epoch >= MAX_EPOCH); if monotonic_delete.event_key.is_exclude_left_key { if largest_key.is_empty() || !KeyComparator::encoded_greater_than_unencoded( @@ -430,7 +430,7 @@ impl SstableBuilder { } } if let Some(monotonic_delete) = self.monotonic_deletes.first() { - assert_ne!(monotonic_delete.new_epoch, HummockEpoch::MAX); + assert!(monotonic_delete.new_epoch < MAX_EPOCH); if smallest_key.is_empty() || !KeyComparator::encoded_less_than_unencoded( user_key(&smallest_key), diff --git a/src/storage/src/hummock/sstable/delete_range_aggregator.rs b/src/storage/src/hummock/sstable/delete_range_aggregator.rs index 952283ce8cff..27b87b484031 100644 --- a/src/storage/src/hummock/sstable/delete_range_aggregator.rs +++ b/src/storage/src/hummock/sstable/delete_range_aggregator.rs @@ -260,14 +260,8 @@ impl CompactionDeleteRanges { && a.new_epoch == b.new_epoch }); if !monotonic_events.is_empty() { - assert_ne!( - monotonic_events.first().unwrap().new_epoch, - HummockEpoch::MAX - ); - assert_eq!( - monotonic_events.last().unwrap().new_epoch, - HummockEpoch::MAX - ); + assert!(monotonic_events.first().unwrap().new_epoch < MAX_EPOCH); + assert!(monotonic_events.last().unwrap().new_epoch >= MAX_EPOCH); } monotonic_events }