From 0a049ae17a02e4d731df2b84c6e5e2f363f6349c Mon Sep 17 00:00:00 2001 From: Konstantin Knizhnik Date: Thu, 5 May 2022 08:53:21 +0300 Subject: [PATCH] Not working version --- pageserver/src/config.rs | 2 +- pageserver/src/layered_repository/delta_layer.rs | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/pageserver/src/config.rs b/pageserver/src/config.rs index 52892e70c6..5f0e9f7d1e 100644 --- a/pageserver/src/config.rs +++ b/pageserver/src/config.rs @@ -22,7 +22,7 @@ use crate::tenant_config::{TenantConf, TenantConfOpt}; pub const ZSTD_MAX_SAMPLES: usize = 1024; pub const ZSTD_MIN_SAMPLES: usize = 8; // magic requirement of zstd -pub const ZSTD_MAX_DICTIONARY_SIZE: usize = 8 * 1024; +pub const ZSTD_MAX_DICTIONARY_SIZE: usize = 64 * 1024; pub const ZSTD_COMPRESSION_LEVEL: i32 = 0; // default compression level pub const ZSTD_DECOMPRESS_BUFFER_LIMIT: usize = 64 * 1024; // TODO: handle larger WAL records? diff --git a/pageserver/src/layered_repository/delta_layer.rs b/pageserver/src/layered_repository/delta_layer.rs index d811c5be9e..c0525beda6 100644 --- a/pageserver/src/layered_repository/delta_layer.rs +++ b/pageserver/src/layered_repository/delta_layer.rs @@ -839,14 +839,13 @@ impl<'a> DeltaValueIter<'a> { true }, )?; + let decompressor = match &inner.prepared_dictionary { + Some(dictionary) => Some(zstd::bulk::Decompressor::with_prepared_dictionary( + dictionary, + )?), + None => None, + }; /* - let mut decompressor = match &inner.prepared_dictionary { - Some(dictionary) => Some(zstd::bulk::Decompressor::with_prepared_dictionary( - dictionary, - )?), - None => None, - }; - */ let decompressor = if !inner.dictionary.is_empty() { Some(zstd::bulk::Decompressor::with_dictionary( &inner.dictionary, @@ -854,6 +853,7 @@ impl<'a> DeltaValueIter<'a> { } else { None }; + */ let iter = DeltaValueIter { all_offsets, next_idx: 0,