Skip to content

Commit

Permalink
store inheritance info in version delta
Browse files Browse the repository at this point in the history
NOTE: Whether to persist inheritance info is not decided yet.

If not to persist, set inheritance info between val commit and memory
commit.

Signed-off-by: MrCroxx <[email protected]>
  • Loading branch information
MrCroxx committed Sep 15, 2023
1 parent 94199e2 commit f5a49d4
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 12 deletions.
19 changes: 10 additions & 9 deletions proto/hummock.proto
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ message HummockVersionDelta {
uint64 safe_epoch = 5;
bool trivial_move = 6;
repeated uint64 gc_object_ids = 7;
map<uint64, Inheritances> inheritances = 8;
}

message HummockVersionDeltas {
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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<uint64, Inheritances> inheritances = 23;
}

Expand Down
1 change: 1 addition & 0 deletions src/meta/src/hummock/manager/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/storage/src/hummock/compactor/compactor_runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit f5a49d4

Please sign in to comment.