Skip to content

Commit

Permalink
fix: adjust rollback_start_live update
Browse files Browse the repository at this point in the history
When a rollback is going to erase all the commits,
`rollback_start_live` will need to be equal to `pending_truncate`.
  • Loading branch information
gabriele-0201 committed Feb 14, 2025
1 parent a155287 commit 3f27ed4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion nomt/src/rollback/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,9 @@ impl Rollback {

// NOTE: for now, if there is a pending truncate, we ignore everything else.
if let Some(pending_truncate) = pending_truncate {
let rollback_start_live = std::cmp::min(seglog.live_range().0.0, pending_truncate);
return WriteoutData {
rollback_start_live: seglog.live_range().0 .0,
rollback_start_live,
rollback_end_live: pending_truncate,
prune_to_new_start_live: None,
prune_to_new_end_live: Some(pending_truncate),
Expand Down

0 comments on commit 3f27ed4

Please sign in to comment.