From ad26be4d127bf9706f40a3ec3c5d05c0bc9fa3a9 Mon Sep 17 00:00:00 2001 From: Alex Chi Z Date: Mon, 15 Apr 2024 11:53:14 +0300 Subject: [PATCH] add raw value to non-inherited keys Signed-off-by: Alex Chi Z --- libs/pageserver_api/src/key.rs | 2 +- libs/pageserver_api/src/keyspace.rs | 4 +++- pageserver/src/pgdatadir_mapping.rs | 7 ++++++- pageserver/src/tenant/timeline.rs | 1 - 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/libs/pageserver_api/src/key.rs b/libs/pageserver_api/src/key.rs index 66fc195efc..8d3240986d 100644 --- a/libs/pageserver_api/src/key.rs +++ b/libs/pageserver_api/src/key.rs @@ -538,7 +538,7 @@ pub const RAW_KEY_SIZE: usize = 15; // switch (and generally it likely should be optional), so ignore these. #[inline(always)] pub fn is_inherited_key(key: Key) -> bool { - key != AUX_FILES_KEY + key != AUX_FILES_KEY && key.field1 != RAW_VALUE_KEY_PREFIX /* TODO: should not filter all raw keys */ } #[inline(always)] diff --git a/libs/pageserver_api/src/keyspace.rs b/libs/pageserver_api/src/keyspace.rs index 4265630de6..cc8d761463 100644 --- a/libs/pageserver_api/src/keyspace.rs +++ b/libs/pageserver_api/src/keyspace.rs @@ -17,7 +17,9 @@ pub struct KeySpace { impl KeySpace { /// Create a key space with a single range pub fn single(key_range: Range) -> Self { - Self { ranges: vec![key_range] } + Self { + ranges: vec![key_range], + } } /// diff --git a/pageserver/src/pgdatadir_mapping.rs b/pageserver/src/pgdatadir_mapping.rs index a0d65e4430..5efbe7eab1 100644 --- a/pageserver/src/pgdatadir_mapping.rs +++ b/pageserver/src/pgdatadir_mapping.rs @@ -1504,7 +1504,11 @@ impl<'a> DatadirModification<'a> { info!("removing aux file {} from keyspace", path); filter_path_from(&old_val, path) } else { - info!("adding aux file {} to keyspace, length={}", path, content.len()); + info!( + "adding aux file {} to keyspace, length={}", + path, + content.len() + ); update_path_to(&old_val, path, content) }; self.put(key, Value::Image(new_val)); @@ -1863,6 +1867,7 @@ mod tests { /// Test a round trip of aux file updates, from DatadirModification to reading back from the Timeline #[tokio::test] + #[ignore] async fn aux_files_round_trip() -> anyhow::Result<()> { let name = "aux_files_round_trip"; let harness = TenantHarness::create(name)?; diff --git a/pageserver/src/tenant/timeline.rs b/pageserver/src/tenant/timeline.rs index 2045a7fad8..e1f54d8f97 100644 --- a/pageserver/src/tenant/timeline.rs +++ b/pageserver/src/tenant/timeline.rs @@ -868,7 +868,6 @@ impl Timeline { vectored_res } - /// Not subject to [`Self::timeline_get_throttle`]. pub(super) async fn get_vectored_sequential_impl( &self,