From 90fca85aeda25b6fd6ce68c2615c291a59bd9673 Mon Sep 17 00:00:00 2001 From: Li0k Date: Fri, 23 Aug 2024 15:48:41 +0800 Subject: [PATCH] revert --- src/storage/src/hummock/sstable/builder.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/storage/src/hummock/sstable/builder.rs b/src/storage/src/hummock/sstable/builder.rs index 3eea5aced3c6..6e647864f02a 100644 --- a/src/storage/src/hummock/sstable/builder.rs +++ b/src/storage/src/hummock/sstable/builder.rs @@ -196,6 +196,11 @@ impl SstableBuilder { mut meta: BlockMeta, ) -> HummockResult { let table_id = smallest_key.user_key.table_id.table_id; + if self.last_table_id.is_none() || self.last_table_id.unwrap() != table_id { + self.table_ids.insert(table_id); + self.finalize_last_table_stats(); + self.last_table_id = Some(table_id); + } if !self.block_builder.is_empty() { let min_block_size = std::cmp::min(MIN_BLOCK_SIZE, self.options.block_capacity / 4); if self.block_builder.approximate_len() < min_block_size { @@ -231,12 +236,6 @@ impl SstableBuilder { let block_meta = self.block_metas.last_mut().unwrap(); self.writer.write_block_bytes(buf, block_meta).await?; - if self.last_table_id.is_none() || self.last_table_id.unwrap() != table_id { - self.table_ids.insert(table_id); - self.finalize_last_table_stats(); - self.last_table_id = Some(table_id); - } - Ok(true) }