Skip to content

Commit

Permalink
Update pageserver/src/tenant/timeline/compaction.rs
Browse files Browse the repository at this point in the history
Co-authored-by: Christian Schwarz <christian@neon.tech>
  • Loading branch information
skyzh and problame authored Dec 6, 2024
1 parent ba52378 commit 43c3492
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions pageserver/src/tenant/timeline/compaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2187,9 +2187,12 @@ impl Timeline {
}
let mut delta_layer_rewriters = HashMap::<Arc<PersistentLayerKey>, RewritingLayers>::new();

/// Returns None if there is no data below the lowest_retain_lsn (either no ancestor branch, or above_lsn is not specified).
/// Throw an error when the key is not found.
///
/// When compacting not at a bottom range (=`[0,X)`) of the root branch, we "have data below" (`has_data_below=true`).
/// The two cases are compaction in ancestor branches and `compact_above_lsn=Some`.
/// In those cases, we need to pull up data from below the LSN range we're compaction.
///
/// This function unifies the cases so that later code doesn't have to think about it.
///
/// Currently, we always get the ancestor image for each key in the child branch no matter whether the image
/// is needed for reconstruction. This should be fixed in the future.
///
Expand Down

0 comments on commit 43c3492

Please sign in to comment.