fix deletion

Signed-off-by: Alex Chi <chi@neon.tech>
This commit is contained in:
Alex Chi
2023-06-27 14:43:20 -04:00
parent dfe8527806
commit 2cb79ae3ff
4 changed files with 3 additions and 12 deletions

View File

@@ -178,9 +178,9 @@ impl LayerCache {
}
fn get_layer_type(layer: &dyn PersistentLayer) -> &'static str {
if layer.is_delta() {
if layer.layer_desc().is_delta() {
&STORAGE_PHYSICAL_SIZE_FILE_TYPE[1]
} else if layer.is_incremental() {
} else if layer.layer_desc().is_incremental() {
&STORAGE_PHYSICAL_SIZE_FILE_TYPE[2]
} else {
&STORAGE_PHYSICAL_SIZE_FILE_TYPE[0]

View File

@@ -353,11 +353,6 @@ pub trait Layer: std::fmt::Debug + Send + Sync {
/// the previous non-incremental layer.
fn is_incremental(&self) -> bool;
/// Is this a delta layer?
fn is_delta(&self) -> bool {
false
}
///
/// Return data needed to reconstruct given page at LSN.
///

View File

@@ -400,10 +400,6 @@ impl Layer for DeltaLayer {
fn short_id(&self) -> String {
self.layer_desc().short_id()
}
fn is_delta(&self) -> bool {
true
}
}
impl PersistentLayer for DeltaLayer {

View File

@@ -2310,7 +2310,7 @@ impl Timeline {
layer: Arc<PersistentLayerDesc>,
_updates: &mut BatchedUpdates<'_>,
) -> anyhow::Result<()> {
warn!("not deleting the layer {layer:?} as old GC is not supposed to run");
self.delete_historic_layer_new(_layer_removal_cs, layer, _updates)?;
Ok(())
}