Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion graph/src/components/store/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1043,7 +1043,9 @@ impl PruneRequest {
));
}

let earliest_block = latest_block - history_blocks;
// We need to add + 1 to `earliset_block` because the lower bound is inclusive
// and otherwise we would end up with `history_blocks + 1` blocks of history instead of `history_blocks`
let earliest_block = latest_block - history_blocks + 1;
let final_block = latest_block - reorg_threshold;

Ok(Self {
Expand Down
2 changes: 1 addition & 1 deletion store/postgres/src/relational/prune.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ impl TablePair {
let column_list = Arc::new(self.column_list());

// Determine the last vid that we need to copy
let range = VidRange::for_prune(conn, &self.src, final_block + 1, BLOCK_NUMBER_MAX).await?;
let range = VidRange::for_prune(conn, &self.src, final_block, BLOCK_NUMBER_MAX).await?;
let mut batcher = VidBatcher::load(conn, &self.src.nsp, &self.src, range).await?;
tracker.start_copy_nonfinal(conn, &self.src, range).await?;

Expand Down