Skip to content

Commit

Permalink
fix equal check
Browse files Browse the repository at this point in the history
Signed-off-by: Little-Wallace <[email protected]>
  • Loading branch information
Little-Wallace committed Nov 28, 2023
1 parent 181a88a commit 8766b07
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/storage/src/hummock/sstable/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ impl<W: SstableWriter, F: FilterBuilder> SstableBuilder<W, F> {
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(
Expand Down Expand Up @@ -430,7 +430,7 @@ impl<W: SstableWriter, F: FilterBuilder> SstableBuilder<W, F> {
}
}
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),
Expand Down
10 changes: 2 additions & 8 deletions src/storage/src/hummock/sstable/delete_range_aggregator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 8766b07

Please sign in to comment.