diff --git a/src/storage/src/hummock/compactor/iterator.rs b/src/storage/src/hummock/compactor/iterator.rs index 52a748d0a0436..b2130be23d13c 100644 --- a/src/storage/src/hummock/compactor/iterator.rs +++ b/src/storage/src/hummock/compactor/iterator.rs @@ -82,7 +82,7 @@ impl SstableStreamIterator { if self .sstable_info .get_table_ids() - .binary_search(&FullKey::decode(block_iter.key()).user_key.table_id.table_id) + .binary_search(&block_iter.key().user_key.table_id.table_id) .is_ok() { return Ok(()); @@ -246,7 +246,8 @@ impl ConcatSstableIterator { seek_key: Option>, ) -> HummockResult<()> { self.sstable_iter.take(); - let seek_key: Option> = match (seek_key, self.key_range.left.is_empty()) { + let mut seek_key: Option> = match (seek_key, self.key_range.left.is_empty()) + { (Some(seek_key), false) => match seek_key.cmp(&FullKey::decode(&self.key_range.left)) { Ordering::Less | Ordering::Equal => Some(FullKey::decode(&self.key_range.left)), Ordering::Greater => Some(seek_key), @@ -559,7 +560,9 @@ mod tests { let block_1_second_key = iter.key().to_vec(); // Use a big enough seek key and result in invalid iterator. let seek_key = test_key_of(30001); - iter.seek_idx(table_infos.len() - 1, Some(seek_key.to_ref())).await.unwrap(); + iter.seek_idx(table_infos.len() - 1, Some(seek_key.to_ref())) + .await + .unwrap(); assert!(!iter.is_valid()); // Test seek_idx. Result is dominated by key range rather than given seek key. diff --git a/src/storage/src/hummock/test_utils.rs b/src/storage/src/hummock/test_utils.rs index 5d760026f0b33..af149f1ac728b 100644 --- a/src/storage/src/hummock/test_utils.rs +++ b/src/storage/src/hummock/test_utils.rs @@ -252,13 +252,13 @@ pub async fn gen_test_sstable>( /// Generate a test table from the given `kv_iter` and put the kv value to `sstable_store` pub async fn gen_test_sstable_and_info>( opts: SstableBuilderOptions, - sst_id: HummockSstableId, + object_id: HummockSstableObjectId, kv_iter: impl Iterator, HummockValue)>, sstable_store: SstableStoreRef, ) -> (Sstable, SstableInfo) { gen_test_sstable_inner( opts, - sst_id, + object_id, kv_iter, vec![], sstable_store,