Skip to content

Commit

Permalink
refactor: remove PersistentLayerDesc::is_incremental
Browse files Browse the repository at this point in the history
  • Loading branch information
koivunej committed Aug 22, 2023
1 parent bd332f8 commit 97d1443
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions pageserver/src/tenant/storage_layer/layer_desc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,8 @@ pub struct PersistentLayerDesc {
/// - For a frozen in-memory layer or a delta layer, this is a valid end bound.
/// - An image layer represents snapshot at one LSN, so end_lsn is always the snapshot LSN + 1
pub lsn_range: Range<Lsn>,
/// Whether this is a delta layer.
/// Whether this is a delta layer, and also, is this incremental.
pub is_delta: bool,
/// Does this layer only contain some data for the key-range (incremental),
/// or does it contain a version of every page? This is important to know
/// for garbage collecting old layers: an incremental layer depends on
/// the previous non-incremental layer.
pub is_incremental: bool,
/// File size
pub file_size: u64,
}
Expand Down Expand Up @@ -68,7 +63,6 @@ impl PersistentLayerDesc {
key_range,
lsn_range: Lsn(0)..Lsn(1),
is_delta: false,
is_incremental: false,
file_size: 0,
}
}
Expand All @@ -86,8 +80,6 @@ impl PersistentLayerDesc {
key_range,
lsn_range: Self::image_layer_lsn_range(lsn),
is_delta: false,
// currently all image layers are non-incremental
is_incremental: false,
file_size,
}
}
Expand All @@ -105,7 +97,6 @@ impl PersistentLayerDesc {
key_range,
lsn_range,
is_delta: true,
is_incremental: true,
file_size,
}
}
Expand Down Expand Up @@ -171,8 +162,12 @@ impl PersistentLayerDesc {
self.tenant_id
}

/// Does this layer only contain some data for the key-range (incremental),
/// or does it contain a version of every page? This is important to know
/// for garbage collecting old layers: an incremental layer depends on
/// the previous non-incremental layer.
pub fn is_incremental(&self) -> bool {
self.is_incremental
self.is_delta
}

pub fn is_delta(&self) -> bool {
Expand Down

0 comments on commit 97d1443

Please sign in to comment.