From 0e56713da7ce2c14b79a924fca822fbaf5c1ca1d Mon Sep 17 00:00:00 2001 From: Liang Zhao Date: Sat, 11 Mar 2023 12:56:48 +0800 Subject: [PATCH] apply #8484 --- src/meta/src/hummock/manager/tests.rs | 4 ++-- .../src/compaction_group/hummock_version_ext.rs | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/meta/src/hummock/manager/tests.rs b/src/meta/src/hummock/manager/tests.rs index e7d8a2cc4480..bd34ad8b99eb 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 af780f5a0335..d2ec336bde91 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(),