diff --git a/proto/hummock.proto b/proto/hummock.proto index 3a7c639f5ac55..c0c0a78e20e76 100644 --- a/proto/hummock.proto +++ b/proto/hummock.proto @@ -140,8 +140,7 @@ message CompactTask { repeated common.ParallelUnitMapping vnode_mappings = 11; // compaction group the task belongs to uint64 compaction_group_id = 12; - - // exist_table_id for compaction drop key + // existing_table_ids for compaction drop key repeated uint32 existing_table_ids = 13; } diff --git a/src/meta/src/hummock/hummock_manager.rs b/src/meta/src/hummock/hummock_manager.rs index c279f32205aa3..cdd881f1f8bb8 100644 --- a/src/meta/src/hummock/hummock_manager.rs +++ b/src/meta/src/hummock/hummock_manager.rs @@ -74,7 +74,7 @@ pub struct HummockManager { // TODO: refactor to remove this field config: Arc, - // for compaction to get some info (e.g. exist_table_id) + // for compaction to get some info (e.g. existing_table_ids) fragment_manager: FragmentManagerRef, } @@ -579,7 +579,7 @@ where task_id as HummockCompactionTaskId, compaction_group_id, ); - let exist_table_id_from_meta = self.fragment_manager.exist_table_ids().await?; + let existing_table_ids_from_meta = self.fragment_manager.existing_table_ids().await?; let ret = match compact_task { None => Ok(None), Some(mut compact_task) => { @@ -635,7 +635,7 @@ where } // to found exist table_id from - if exist_table_id_from_meta.contains(&table_id) { + if existing_table_ids_from_meta.contains(&table_id) { compact_task.existing_table_ids.push(table_id); } } diff --git a/src/meta/src/stream/meta.rs b/src/meta/src/stream/meta.rs index 17afdd36aae74..ef781f15f5319 100644 --- a/src/meta/src/stream/meta.rs +++ b/src/meta/src/stream/meta.rs @@ -467,9 +467,9 @@ where Ok(()) } - // exist_table_id include the table_ref_id (source and materialized_view) + internal_table_id + // existing_table_ids include the table_ref_id (source and materialized_view) + internal_table_id // (stateful executor) - pub async fn exist_table_ids(&self) -> Result> { + pub async fn existing_table_ids(&self) -> Result> { let mut result_set = HashSet::default(); let map = &self.core.read().await.table_fragments; diff --git a/src/storage/src/hummock/compactor_tests.rs b/src/storage/src/hummock/compactor_tests.rs index 6fd252feefb69..6f69f8a5ff3c9 100644 --- a/src/storage/src/hummock/compactor_tests.rs +++ b/src/storage/src/hummock/compactor_tests.rs @@ -269,14 +269,14 @@ mod tests { let val = Bytes::from(b"0"[..].repeat(4 << 20)); // 4MB value let drop_table_id = 1; - let exist_table_id = 2; + let existing_table_ids = 2; let kv_count = 128; let mut epoch: u64 = 1; for index in 0..kv_count { let table_id = if index % 2 == 0 { drop_table_id } else { - exist_table_id + existing_table_ids }; let keyspace = Keyspace::table_root(storage.clone(), &TableId::new(table_id)); let mut write_batch = keyspace.state_store().start_write_batch(); @@ -359,7 +359,7 @@ mod tests { let mut scan_count = 0; for (k, _) in scan_result { let table_id = get_table_id(&k).unwrap(); - assert_eq!(table_id, exist_table_id); + assert_eq!(table_id, existing_table_ids); scan_count += 1; } assert_eq!(key_count, scan_count);