Skip to content

Commit 72504e3

Browse files
committed
Improve error handling and error messages
Handle table vacuum failures by continuing execution, as these are typically caused by transient object storage issues.
1 parent b50fc83 commit 72504e3

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

src/query/service/src/table_functions/fuse_vacuum2/fuse_vacuum2_table.rs

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ use databend_common_storages_fuse::FuseTable;
4141
use databend_enterprise_vacuum_handler::get_vacuum_handler;
4242
use databend_enterprise_vacuum_handler::VacuumHandlerWrapper;
4343
use log::info;
44+
use log::warn;
4445

4546
use crate::sessions::TableContext;
4647

@@ -191,14 +192,19 @@ impl FuseVacuum2Table {
191192
continue;
192193
}
193194

194-
info!("Processing db {}, {}/{}", db.name(), idx_db + 1, num_db);
195+
info!(
196+
"Processing db {}, progress: {}/{}",
197+
db.name(),
198+
idx_db + 1,
199+
num_db
200+
);
195201
let tables = catalog.list_tables(&tenant_id, db.name()).await?;
196202
info!("Found {} tables in db {}", tables.len(), db.name());
197203

198204
let num_tbl = tables.len();
199205
for (idx_tbl, table) in tables.iter().enumerate() {
200206
info!(
201-
"Processing table {}.{}, {}/{}",
207+
"Processing table {}.{}, db level progress: {}/{}",
202208
db.name(),
203209
table.get_table_info().name,
204210
idx_tbl + 1,
@@ -223,7 +229,16 @@ impl FuseVacuum2Table {
223229
continue;
224230
}
225231

226-
let _ = self.handler.do_vacuum2(tbl, ctx.clone(), false).await?;
232+
let res = self.handler.do_vacuum2(tbl, ctx.clone(), false).await;
233+
234+
if let Err(e) = res {
235+
warn!(
236+
"vacuum2 table {}.{} failed: {}",
237+
db.name(),
238+
table.get_table_info().name,
239+
e
240+
);
241+
};
227242
}
228243
}
229244

0 commit comments

Comments
 (0)