From 302a58e8ea80a6aa63396e39650d71bc99e15057 Mon Sep 17 00:00:00 2001 From: Joonas Koivunen Date: Tue, 29 Aug 2023 11:55:08 +0300 Subject: [PATCH] image/deltalayer: shuffle comments around --- pageserver/src/tenant/storage_layer/delta_layer.rs | 14 ++++---------- pageserver/src/tenant/storage_layer/image_layer.rs | 14 ++++---------- 2 files changed, 8 insertions(+), 20 deletions(-) diff --git a/pageserver/src/tenant/storage_layer/delta_layer.rs b/pageserver/src/tenant/storage_layer/delta_layer.rs index 7f195b7d59..4e53e91a05 100644 --- a/pageserver/src/tenant/storage_layer/delta_layer.rs +++ b/pageserver/src/tenant/storage_layer/delta_layer.rs @@ -179,20 +179,12 @@ impl DeltaKey { } } -/// DeltaLayer is the in-memory data structure associated with an on-disk delta -/// file. -/// -/// We keep a DeltaLayer in memory for each file, in the LayerMap. If a layer -/// is in "loaded" state, we have a copy of the index in memory, in 'inner'. -/// Otherwise the struct is just a placeholder for a file that exists on disk, -/// and it needs to be loaded before using it in queries. +/// This is used only from `pagectl`. Within pageserver, all layers are +/// [`crate::tenant::storage_layer::Layer`], which can hold a [`DeltaLayerInner`]. pub struct DeltaLayer { path: PathBuf, - pub desc: PersistentLayerDesc, - access_stats: LayerAccessStats, - inner: OnceCell>, } @@ -209,6 +201,8 @@ impl std::fmt::Debug for DeltaLayer { } } +/// `DeltaLayerInner` is the in-memory data structure associated with an on-disk delta +/// file. pub struct DeltaLayerInner { // values copied from summary index_start_blk: u32, diff --git a/pageserver/src/tenant/storage_layer/image_layer.rs b/pageserver/src/tenant/storage_layer/image_layer.rs index 54261c95a3..6445d96987 100644 --- a/pageserver/src/tenant/storage_layer/image_layer.rs +++ b/pageserver/src/tenant/storage_layer/image_layer.rs @@ -117,22 +117,14 @@ impl Summary { } } -/// ImageLayer is the in-memory data structure associated with an on-disk image -/// file. -/// -/// We keep an ImageLayer in memory for each file, in the LayerMap. If a layer -/// is in "loaded" state, we have a copy of the index in memory, in 'inner'. -/// Otherwise the struct is just a placeholder for a file that exists on disk, -/// and it needs to be loaded before using it in queries. +/// This is used only from `pagectl`. Within pageserver, all layers are +/// [`crate::tenant::storage_layer::Layer`], which can hold an [`ImageLayerInner`]. pub struct ImageLayer { path: PathBuf, - pub desc: PersistentLayerDesc, // This entry contains an image of all pages as of this LSN, should be the same as desc.lsn pub lsn: Lsn, - access_stats: LayerAccessStats, - inner: OnceCell, } @@ -149,6 +141,8 @@ impl std::fmt::Debug for ImageLayer { } } +/// ImageLayer is the in-memory data structure associated with an on-disk image +/// file. pub struct ImageLayerInner { // values copied from summary index_start_blk: u32,