From a2138c2c9088e7d87f4f96e450d2371d04eb9f6e Mon Sep 17 00:00:00 2001 From: Alex Chi Z Date: Mon, 9 Sep 2024 14:56:52 +0100 Subject: [PATCH] resolve comments Signed-off-by: Alex Chi Z --- libs/pageserver_api/src/key.rs | 9 --------- pageserver/src/tenant/storage_layer/split_writer.rs | 9 ++------- pageserver/src/tenant/timeline/compaction.rs | 1 - 3 files changed, 2 insertions(+), 17 deletions(-) diff --git a/libs/pageserver_api/src/key.rs b/libs/pageserver_api/src/key.rs index 77d744e4da21..8929ccb41d6f 100644 --- a/libs/pageserver_api/src/key.rs +++ b/libs/pageserver_api/src/key.rs @@ -263,15 +263,6 @@ impl Key { field5: u8::MAX, field6: u32::MAX, }; - /// A key slightly smaller than [`Key::MAX`] for use in layer key ranges to avoid them to be confused with L0 layers - pub const NON_L0_MAX: Key = Key { - field1: u8::MAX, - field2: u32::MAX, - field3: u32::MAX, - field4: u32::MAX, - field5: u8::MAX, - field6: u32::MAX - 1, - }; pub fn from_hex(s: &str) -> Result { if s.len() != 36 { diff --git a/pageserver/src/tenant/storage_layer/split_writer.rs b/pageserver/src/tenant/storage_layer/split_writer.rs index 43e34526be0e..40a6a77a5013 100644 --- a/pageserver/src/tenant/storage_layer/split_writer.rs +++ b/pageserver/src/tenant/storage_layer/split_writer.rs @@ -188,7 +188,7 @@ impl SplitImageLayerWriter { .await } - /// When split writer fails, the caller should call this function and handle partially generated layers. + /// This function will be deprecated with #8841. pub(crate) fn take(self) -> anyhow::Result<(Vec, ImageLayerWriter)> { Ok((self.generated_layers, self.inner)) } @@ -221,7 +221,6 @@ impl SplitDeltaLayerWriter { tenant_shard_id: TenantShardId, lsn_range: Range, target_layer_size: u64, - #[allow(unused)] ctx: &RequestContext, ) -> anyhow::Result { Ok(Self { target_layer_size, @@ -375,7 +374,7 @@ impl SplitDeltaLayerWriter { .await } - /// When split writer fails, the caller should call this function and handle partially generated layers. + /// This function will be deprecated with #8841. pub(crate) fn take(self) -> anyhow::Result<(Vec, Option)> { Ok((self.generated_layers, self.inner.map(|x| x.1))) } @@ -443,7 +442,6 @@ mod tests { tenant.tenant_shard_id, Lsn(0x18)..Lsn(0x20), 4 * 1024 * 1024, - &ctx, ) .await .unwrap(); @@ -522,7 +520,6 @@ mod tests { tenant.tenant_shard_id, Lsn(0x18)..Lsn(0x20), 4 * 1024 * 1024, - &ctx, ) .await .unwrap(); @@ -627,7 +624,6 @@ mod tests { tenant.tenant_shard_id, Lsn(0x18)..Lsn(0x20), 4 * 1024, - &ctx, ) .await .unwrap(); @@ -716,7 +712,6 @@ mod tests { tenant.tenant_shard_id, Lsn(0x10)..Lsn(N as u64 * 16 + 0x10), 4 * 1024 * 1024, - &ctx, ) .await .unwrap(); diff --git a/pageserver/src/tenant/timeline/compaction.rs b/pageserver/src/tenant/timeline/compaction.rs index d58c39557123..0b5c520ba7ad 100644 --- a/pageserver/src/tenant/timeline/compaction.rs +++ b/pageserver/src/tenant/timeline/compaction.rs @@ -1856,7 +1856,6 @@ impl Timeline { self.tenant_shard_id, lowest_retain_lsn..end_lsn, self.get_compaction_target_size(), - ctx, ) .await?;