From dec1c4f0d8e9400b98888e923f941e9b54d40c3e Mon Sep 17 00:00:00 2001 From: zwang28 <70626450+zwang28@users.noreply.github.com> Date: Tue, 18 Jun 2024 15:25:17 +0800 Subject: [PATCH] fix(ctl): fix sst_dump (#17302) --- src/ctl/src/cmd_impl/hummock/sst_dump.rs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/ctl/src/cmd_impl/hummock/sst_dump.rs b/src/ctl/src/cmd_impl/hummock/sst_dump.rs index ce69ab87f1b7c..3a71fbd007214 100644 --- a/src/ctl/src/cmd_impl/hummock/sst_dump.rs +++ b/src/ctl/src/cmd_impl/hummock/sst_dump.rs @@ -15,7 +15,6 @@ use std::collections::HashMap; use std::sync::Arc; -use anyhow::anyhow; use bytes::{Buf, Bytes}; use chrono::offset::Utc; use chrono::DateTime; @@ -123,11 +122,7 @@ pub async fn sst_dump(context: &CtlContext, args: SstDumpArgs) -> anyhow::Result if let Some(obj_id) = &args.object_id { let obj_store = sstable_store.store(); let obj_path = sstable_store.get_sst_data_path(*obj_id); - let mut obj_metadata_iter = obj_store.list(&obj_path).await?; - let obj = obj_metadata_iter - .try_next() - .await? - .ok_or_else(|| anyhow!(format!("object {obj_path} doesn't exist")))?; + let obj = obj_store.metadata(&obj_path).await?; print_object(&obj); let meta_offset = get_meta_offset_from_object(&obj, obj_store.as_ref()).await?; let obj_id = SstableStore::get_object_id_from_path(&obj.key);