From 420e892b462026531f3ba04c9bf9d9173695a8e5 Mon Sep 17 00:00:00 2001 From: Zhenchi Date: Fri, 16 Feb 2024 06:13:44 +0000 Subject: [PATCH] fix(index): sanitize S3 upload buffer size Signed-off-by: Zhenchi --- src/mito2/src/config.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/mito2/src/config.rs b/src/mito2/src/config.rs index cc25be263bf6..32376aa802ed 100644 --- a/src/mito2/src/config.rs +++ b/src/mito2/src/config.rs @@ -294,6 +294,14 @@ impl InvertedIndexConfig { self.intermediate_path = join_dir(data_home, "index_intermediate"); } + if self.write_buffer_size < MULTIPART_UPLOAD_MINIMUM_SIZE { + self.write_buffer_size = MULTIPART_UPLOAD_MINIMUM_SIZE; + warn!( + "Sanitize index write buffer size to {}", + self.write_buffer_size + ); + } + Ok(()) } }