From 9556907fde19e80c05d07b4c9dd305c37efb12d9 Mon Sep 17 00:00:00 2001 From: Li0k Date: Fri, 6 Sep 2024 14:32:21 +0800 Subject: [PATCH 1/2] fix(storage): fix duplicated sst_id generated by split_sst function --- .../hummock_sdk/src/compaction_group/hummock_version_ext.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 13a0bcc08adf..ab5f8b8cea7a 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 @@ -1330,7 +1330,8 @@ pub fn validate_version(version: &HummockVersion) -> Vec { pub fn split_sst(sst_info: &mut SstableInfo, new_sst_id: &mut u64) -> SstableInfo { let mut branch_table_info = sst_info.clone(); branch_table_info.sst_id = *new_sst_id; - sst_info.sst_id = *new_sst_id + 1; + *new_sst_id += 1; + sst_info.sst_id = *new_sst_id; *new_sst_id += 1; branch_table_info From fd0ecabaf9a5718736f52c721c2b00f8f16b6fd8 Mon Sep 17 00:00:00 2001 From: Li0k Date: Fri, 6 Sep 2024 15:31:25 +0800 Subject: [PATCH 2/2] fix(storage): fix new_sst_id_number --- src/meta/src/hummock/manager/commit_epoch.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/meta/src/hummock/manager/commit_epoch.rs b/src/meta/src/hummock/manager/commit_epoch.rs index 0c07ca6f09fb..812e102f579f 100644 --- a/src/meta/src/hummock/manager/commit_epoch.rs +++ b/src/meta/src/hummock/manager/commit_epoch.rs @@ -402,7 +402,7 @@ impl HummockManager { } } - new_sst_id_number += group_table_ids.len(); + new_sst_id_number += group_table_ids.len() * 2; sst_to_cg_vec.push((commit_sst, group_table_ids)); }