From 2a088b997553fa83049bf7e0d83ce48dd93f2575 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Thu, 12 May 2022 15:40:55 +0200 Subject: [PATCH] datastore: drop bogus chunk size check, can cause trouble other sizes can happen in legitimate and illegitimate ways: - illegitimate: encryped chunks and bad actor client - legitimate: same chunk but newer zstd version (or compression level) can compress it better (or worse) so the Ideally we could take the actual smaller chunk so that improved zstd tech gets leveraged, but we could only allow to do that for un-encrypted ones. Signed-off-by: Thomas Lamprecht --- pbs-datastore/src/chunk_store.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pbs-datastore/src/chunk_store.rs b/pbs-datastore/src/chunk_store.rs index e7a9eeac..5bfe9fac 100644 --- a/pbs-datastore/src/chunk_store.rs +++ b/pbs-datastore/src/chunk_store.rs @@ -452,10 +452,12 @@ impl ChunkStore { } else if old_size == 0 { log::warn!("found empty chunk '{digest_str}' in store {name}, overwriting"); } else { - bail!( - "found chunk size mismatch for '{digest_str}': old {old_size} - new \ - {encoded_size}" - ); + // other sizes can happen in legitimate and illegitimate ways: + // - illegitimate: encryped chunks and bad actor client + // - legitimate: same chunk but newer zstd version (or compression level) can + // compress it better (or worse) so the + // Ideally we could take the actual smaller chunk so that improved zstd tech gets + // leveraged, but we could only allow to do that for un-encrypted ones. } }