From 46ab9ebe0283d2df455a884d51e8cbbc29972b2e Mon Sep 17 00:00:00 2001 From: discord9 Date: Thu, 4 Dec 2025 11:10:52 +0800 Subject: [PATCH] per review Signed-off-by: discord9 --- src/mito2/src/access_layer.rs | 3 ++- src/mito2/src/cache/index/result_cache.rs | 2 -- src/mito2/src/engine/puffin_index.rs | 2 -- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/mito2/src/access_layer.rs b/src/mito2/src/access_layer.rs index 7de2269356..f5c7ba79f9 100644 --- a/src/mito2/src/access_layer.rs +++ b/src/mito2/src/access_layer.rs @@ -476,9 +476,10 @@ impl TempFileCleaner { } /// Removes the SST and index file from the local atomic dir by the file id. + /// This only remove the initial index, Since the index version is always 0 for a new SST, this method should be safe to pass 0. pub(crate) async fn clean_by_file_id(&self, file_id: FileId) { let sst_key = IndexKey::new(self.region_id, file_id, FileType::Parquet).to_string(); - let index_key = IndexKey::new(self.region_id, file_id, FileType::Puffin(0)).to_string(); // TODO(discord9): confirm correctness + let index_key = IndexKey::new(self.region_id, file_id, FileType::Puffin(0)).to_string(); Self::clean_atomic_dir_files(&self.object_store, &[&sst_key, &index_key]).await; } diff --git a/src/mito2/src/cache/index/result_cache.rs b/src/mito2/src/cache/index/result_cache.rs index 925f1df249..1b14c9d981 100644 --- a/src/mito2/src/cache/index/result_cache.rs +++ b/src/mito2/src/cache/index/result_cache.rs @@ -35,8 +35,6 @@ const INDEX_RESULT_TYPE: &str = "index_result"; /// /// Row groups can be partially searched. Row groups that not contained in `RowGroupSelection` are not searched. /// User can retrieve the partial results and handle uncontained row groups required by the predicate subsequently. -/// -/// FIXME(discord9): confirm if this key need version? pub struct IndexResultCache { cache: Cache<(PredicateKey, FileId), Arc>, } diff --git a/src/mito2/src/engine/puffin_index.rs b/src/mito2/src/engine/puffin_index.rs index fd4621d154..281b619bc5 100644 --- a/src/mito2/src/engine/puffin_index.rs +++ b/src/mito2/src/engine/puffin_index.rs @@ -172,8 +172,6 @@ pub(crate) async fn collect_index_entries_from_puffin( Some(BlobIndexTypeTargetKey::Inverted) => { let mut inverted_entries = collect_inverted_entries( &reader, - // version is not needed here since rebuild index would be another type of index(and this one will invalidate) - // and building a new index also wouldn't be in the cache region_index_id, inverted_index_cache.as_ref(), &context,