diff --git a/src/meta/src/hummock/manager/tests.rs b/src/meta/src/hummock/manager/tests.rs index e321952289ebc..2e7ef00a89ff4 100644 --- a/src/meta/src/hummock/manager/tests.rs +++ b/src/meta/src/hummock/manager/tests.rs @@ -1511,7 +1511,7 @@ async fn test_split_compaction_group_on_demand_basic() { assert_eq!(branched_ssts.len(), 2); for object_id in [10, 11] { assert_eq!(branched_ssts.get(&object_id).unwrap().len(), 1); - assert_eq!( + assert_ne!( branched_ssts .get(&object_id) .unwrap() @@ -1519,7 +1519,7 @@ async fn test_split_compaction_group_on_demand_basic() { .cloned() .unwrap(), object_id, - "trivial adjust doesn't generate a new SST id" + "trivial adjust should also generate a new SST id" ); } } diff --git a/src/storage/hummock_sdk/src/compaction_group/hummock_version_ext.rs b/src/storage/hummock_sdk/src/compaction_group/hummock_version_ext.rs index af780f5a0335e..d2ec336bde911 100644 --- a/src/storage/hummock_sdk/src/compaction_group/hummock_version_ext.rs +++ b/src/storage/hummock_sdk/src/compaction_group/hummock_version_ext.rs @@ -234,11 +234,11 @@ impl HummockVersionUpdateExt for HummockVersion { .iter() .all(|table_id| member_table_ids.contains(table_id)); let mut branch_table_info = sst_info.clone(); + branch_table_info.sst_id = new_sst_id; + new_sst_id += 1; if !is_trivial { sst_info.sst_id = new_sst_id; new_sst_id += 1; - branch_table_info.sst_id = new_sst_id; - new_sst_id += 1; } split_id_vers.push(( branch_table_info.get_object_id(), @@ -285,11 +285,11 @@ impl HummockVersionUpdateExt for HummockVersion { .iter() .all(|table_id| member_table_ids.contains(table_id)); let mut branch_table_info = sst_info.clone(); + branch_table_info.sst_id = new_sst_id; + new_sst_id += 1; if !is_trivial { sst_info.sst_id = new_sst_id; new_sst_id += 1; - branch_table_info.sst_id = new_sst_id; - new_sst_id += 1; } split_id_vers.push(( branch_table_info.get_object_id(),