From 97d1443ed989409456fdf410f2ada1c5987457f4 Mon Sep 17 00:00:00 2001 From: Joonas Koivunen Date: Tue, 22 Aug 2023 17:00:19 +0300 Subject: [PATCH] refactor: remove PersistentLayerDesc::is_incremental --- .../src/tenant/storage_layer/layer_desc.rs | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/pageserver/src/tenant/storage_layer/layer_desc.rs b/pageserver/src/tenant/storage_layer/layer_desc.rs index c91f18f240de..59ca0f33e0fd 100644 --- a/pageserver/src/tenant/storage_layer/layer_desc.rs +++ b/pageserver/src/tenant/storage_layer/layer_desc.rs @@ -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, - /// 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, } @@ -68,7 +63,6 @@ impl PersistentLayerDesc { key_range, lsn_range: Lsn(0)..Lsn(1), is_delta: false, - is_incremental: false, file_size: 0, } } @@ -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, } } @@ -105,7 +97,6 @@ impl PersistentLayerDesc { key_range, lsn_range, is_delta: true, - is_incremental: true, file_size, } } @@ -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 {