Skip to content

Commit

Permalink
fix(meta): adapt time travel for partial checkpoint (#18093)
Browse files Browse the repository at this point in the history
  • Loading branch information
zwang28 authored Aug 19, 2024
1 parent da74340 commit a9bfcd2
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/meta/src/hummock/manager/time_travel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -395,9 +395,13 @@ impl HummockManager {
version_id: Set(version_id.try_into().unwrap()),
};
hummock_epoch_to_version::Entity::insert(m)
.on_conflict(
OnConflict::column(hummock_epoch_to_version::Column::Epoch)
.update_columns([hummock_epoch_to_version::Column::VersionId])
.to_owned(),
)
.exec(txn)
.await?;

let mut version_sst_ids = None;
let select_groups = group_parents
.iter()
Expand Down Expand Up @@ -483,14 +487,8 @@ fn replay_archive(
deltas: impl Iterator<Item = PbHummockVersionDelta>,
) -> HummockVersion {
let mut last_version = HummockVersion::from_persisted_protobuf(&version);
let mut mce = last_version.visible_table_committed_epoch();
for d in deltas {
let d = HummockVersionDelta::from_persisted_protobuf(&d);
assert!(
d.visible_table_committed_epoch() > mce,
"time travel expects delta from commit_epoch only"
);
mce = d.visible_table_committed_epoch();
// Need to work around the assertion in `apply_version_delta`.
// Because compaction deltas are not included in time travel archive.
while last_version.id < d.prev_id {
Expand Down

0 comments on commit a9bfcd2

Please sign in to comment.