From f151c4074fe13f074d091c31f9f80da347f0f192 Mon Sep 17 00:00:00 2001 From: Li0k Date: Mon, 17 Jun 2024 16:23:46 +0800 Subject: [PATCH] fix(storage): remove compaction_group_index from pin version --- src/storage/src/hummock/event_handler/uploader.rs | 4 +--- .../src/hummock/local_version/pinned_version.rs | 13 ++----------- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/src/storage/src/hummock/event_handler/uploader.rs b/src/storage/src/hummock/event_handler/uploader.rs index f768aa23dcd89..5878b14730083 100644 --- a/src/storage/src/hummock/event_handler/uploader.rs +++ b/src/storage/src/hummock/event_handler/uploader.rs @@ -35,7 +35,7 @@ use risingwave_common::must_match; use risingwave_hummock_sdk::table_watermark::{ TableWatermarks, VnodeWatermark, WatermarkDirection, }; -use risingwave_hummock_sdk::{CompactionGroupId, HummockEpoch, LocalSstableInfo, SyncResult}; +use risingwave_hummock_sdk::{HummockEpoch, LocalSstableInfo, SyncResult}; use thiserror_ext::AsReport; use tokio::sync::oneshot; use tokio::task::JoinHandle; @@ -84,7 +84,6 @@ pub struct UploadTaskInfo { pub task_size: usize, pub epochs: Vec, pub imm_ids: HashMap>, - pub compaction_group_index: Arc>, } impl Display for UploadTaskInfo { @@ -241,7 +240,6 @@ impl UploadingTask { task_size, epochs, imm_ids, - compaction_group_index: context.pinned_version.compaction_group_index(), }; context .buffer_tracker diff --git a/src/storage/src/hummock/local_version/pinned_version.rs b/src/storage/src/hummock/local_version/pinned_version.rs index 5e89a135d825c..4926914a44004 100644 --- a/src/storage/src/hummock/local_version/pinned_version.rs +++ b/src/storage/src/hummock/local_version/pinned_version.rs @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -use std::collections::{BTreeMap, HashMap}; +use std::collections::BTreeMap; use std::iter::empty; use std::sync::Arc; use std::time::{Duration, Instant}; @@ -75,7 +75,6 @@ impl Drop for PinnedVersionGuard { #[derive(Clone)] pub struct PinnedVersion { version: Arc, - compaction_group_index: Arc>, guard: Arc, } @@ -85,11 +84,9 @@ impl PinnedVersion { pinned_version_manager_tx: UnboundedSender, ) -> Self { let version_id = version.id; - let compaction_group_index = version.state_table_info.build_table_compaction_group_id(); PinnedVersion { version: Arc::new(version), - compaction_group_index: Arc::new(compaction_group_index), guard: Arc::new(PinnedVersionGuard::new( version_id, pinned_version_manager_tx, @@ -97,10 +94,6 @@ impl PinnedVersion { } } - pub(crate) fn compaction_group_index(&self) -> Arc> { - self.compaction_group_index.clone() - } - pub fn new_pin_version(&self, version: HummockVersion) -> Self { assert!( version.id >= self.version.id, @@ -108,12 +101,10 @@ impl PinnedVersion { version.id, self.version.id ); - let version_id = version.id; - let compaction_group_index = version.state_table_info.build_table_compaction_group_id(); + let version_id: u64 = version.id; PinnedVersion { version: Arc::new(version), - compaction_group_index: Arc::new(compaction_group_index), guard: Arc::new(PinnedVersionGuard::new( version_id, self.guard.pinned_version_manager_tx.clone(),