Skip to content

Commit

Permalink
feat(storage): remove table watermarks of dropped tables (#13960)
Browse files Browse the repository at this point in the history
  • Loading branch information
wenym1 authored Dec 14, 2023
1 parent 64a2d92 commit 016e58e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions proto/hummock.proto
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ message HummockVersionDelta {
bool trivial_move = 6;
repeated uint64 gc_object_ids = 7;
map<uint32, TableWatermarks> new_table_watermarks = 8;
repeated uint32 removed_table_ids = 9;
}

message HummockVersionDeltas {
Expand Down
1 change: 1 addition & 0 deletions src/meta/src/hummock/manager/compaction_group_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,7 @@ impl HummockManager {
.len() as u64
- 1,
);
new_version_delta.removed_table_ids.push(*table_id);
}

// Remove empty group, GC SSTs and remove metric.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,9 @@ impl HummockVersion {
}
self.id = version_delta.id;
self.max_committed_epoch = version_delta.max_committed_epoch;
for table_id in &version_delta.removed_table_ids {
let _ = self.table_watermarks.remove(table_id);
}
for (table_id, table_watermarks) in &version_delta.new_table_watermarks {
match self.table_watermarks.entry(*table_id) {
Entry::Occupied(mut entry) => {
Expand Down Expand Up @@ -1010,6 +1013,7 @@ pub fn build_version_delta_after_version(version: &HummockVersion) -> HummockVer
group_deltas: Default::default(),
gc_object_ids: vec![],
new_table_watermarks: HashMap::new(),
removed_table_ids: vec![],
}
}

Expand Down

0 comments on commit 016e58e

Please sign in to comment.