Skip to content

Commit a095131

Browse files
authored
chore: polish error message in CommitSink (#17558)
If previous table snapshot not found during commiting, report more user friendly error messages.
1 parent a723a44 commit a095131

File tree

1 file changed

+9
-1
lines changed
  • src/query/storages/fuse/src/operations/common/processors

1 file changed

+9
-1
lines changed

src/query/storages/fuse/src/operations/common/processors/sink_commit.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,15 @@ where F: SnapshotGenerator + Send + 'static
334334
let schema = self.table.schema().as_ref().clone();
335335

336336
let fuse_table = FuseTable::try_from_table(self.table.as_ref())?.to_owned();
337-
let previous = fuse_table.read_table_snapshot().await?;
337+
let previous = fuse_table.read_table_snapshot().await.map_err(|e| {
338+
if e.code() == ErrorCode::STORAGE_NOT_FOUND {
339+
e.add_message(
340+
"Previous table snapshot not found. This could indicate the table is currently being vacuumed. Please check the settings for `data_retention_time_in_days` and the table option `data_retention_period_in_hours` to ensure they are not set too low.",
341+
)
342+
} else {
343+
e
344+
}
345+
})?;
338346
// save current table info when commit to meta server
339347
// if table_id not match, update table meta will fail
340348
let table_info = fuse_table.table_info.clone();

0 commit comments

Comments
 (0)