diff --git a/proto/hummock.proto b/proto/hummock.proto index 6bf64ffa1d98..3ebf8861dafe 100644 --- a/proto/hummock.proto +++ b/proto/hummock.proto @@ -133,6 +133,7 @@ message HummockVersionDelta { uint64 safe_epoch = 5; bool trivial_move = 6; repeated uint64 gc_object_ids = 7; + map inheritances = 8; } message HummockVersionDeltas { @@ -243,6 +244,15 @@ message TableOption { uint32 retention_seconds = 1; } +// Compaction block-level inheritance info for cache refill. +message Inheritances { + message Inheritance { + uint64 parent_sst_obj_id = 1; + uint64 parent_sst_blk_idx = 2; + } + repeated Inheritance inheritances = 1; +} + message CompactTask { enum TaskStatus { UNSPECIFIED = 0; @@ -302,15 +312,6 @@ message CompactTask { bool split_by_state_table = 21; // Compaction needs to cut the state table every time 1/weight of vnodes in the table have been processed. uint32 split_weight_by_vnode = 22; - - message Inheritances { - message Inheritance { - uint64 parent_sst_obj_id = 1; - uint64 parent_sst_blk_idx = 2; - } - repeated Inheritance inheritances = 1; - } - // Compaction block-level inheritance info for cache refill. map inheritances = 23; } diff --git a/src/meta/src/hummock/manager/mod.rs b/src/meta/src/hummock/manager/mod.rs index 99f0c41d696d..f8d818ba1d31 100644 --- a/src/meta/src/hummock/manager/mod.rs +++ b/src/meta/src/hummock/manager/mod.rs @@ -2764,6 +2764,7 @@ fn gen_version_delta<'a>( prev_id: old_version.id, max_committed_epoch: old_version.max_committed_epoch, trivial_move, + inheritances: compact_task.inheritances.clone(), ..Default::default() }; let group_deltas = &mut version_delta 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 1193877a14c9..9b7d0e329f1e 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 @@ -994,6 +994,7 @@ pub fn build_version_delta_after_version(version: &HummockVersion) -> HummockVer max_committed_epoch: version.max_committed_epoch, group_deltas: Default::default(), gc_object_ids: vec![], + inheritances: Default::default(), } } diff --git a/src/storage/src/hummock/compactor/compactor_runner.rs b/src/storage/src/hummock/compactor/compactor_runner.rs index 4342830905cf..3fc024e300db 100644 --- a/src/storage/src/hummock/compactor/compactor_runner.rs +++ b/src/storage/src/hummock/compactor/compactor_runner.rs @@ -27,9 +27,9 @@ use risingwave_hummock_sdk::key::{FullKey, PointRange}; use risingwave_hummock_sdk::key_range::{KeyRange, KeyRangeCommon}; use risingwave_hummock_sdk::table_stats::{add_table_stats_map, TableStats, TableStatsMap}; use risingwave_hummock_sdk::{can_concat, HummockEpoch, HummockSstableObjectId}; -use risingwave_pb::hummock::compact_task::inheritances::Inheritance; -use risingwave_pb::hummock::compact_task::{Inheritances, TaskStatus}; -use risingwave_pb::hummock::{CompactTask, LevelType, SstableInfo}; +use risingwave_pb::hummock::compact_task::TaskStatus; +use risingwave_pb::hummock::inheritances::Inheritance; +use risingwave_pb::hummock::{CompactTask, Inheritances, LevelType, SstableInfo}; use tokio::sync::oneshot::Receiver; use super::task_progress::TaskProgress;