Skip to content

Commit 21a3416

Browse files
authored
refactor: remove timeout from snapshot hint refresh process (#17532)
1 parent 98c3da7 commit 21a3416

File tree

1 file changed

+2
-24
lines changed

1 file changed

+2
-24
lines changed

src/query/storages/fuse/src/fuse_table.rs

+2-24
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ use std::time::Instant;
2525
use async_channel::Receiver;
2626
use chrono::Duration;
2727
use chrono::TimeDelta;
28-
use databend_common_base::base::tokio;
2928
use databend_common_base::runtime::GlobalIORuntime;
3029
use databend_common_catalog::catalog::StorageDescription;
3130
use databend_common_catalog::plan::DataSourcePlan;
@@ -150,8 +149,6 @@ pub struct FuseTable {
150149
type PartInfoReceiver = Option<Receiver<Result<PartInfoPtr>>>;
151150

152151
// default schema refreshing timeout is 5 seconds.
153-
const DEFAULT_SCHEMA_REFRESHING_TIMEOUT: std::time::Duration = std::time::Duration::from_secs(5);
154-
155152
impl FuseTable {
156153
pub fn try_create(table_info: TableInfo) -> Result<Box<dyn Table>> {
157154
Ok(Self::do_create_table_ext(table_info, false)?)
@@ -485,7 +482,6 @@ impl FuseTable {
485482
fn refresh_schema_from_hint(
486483
operator: &Operator,
487484
storage_prefix: &str,
488-
table_description: &str,
489485
) -> Result<Option<(SnapshotHint, TableSchema)>> {
490486
let refresh_task = async {
491487
let begin_load_hint = Instant::now();
@@ -529,24 +525,7 @@ impl FuseTable {
529525
}
530526
};
531527

532-
let refresh_task_with_timeout = async {
533-
tokio::time::timeout(DEFAULT_SCHEMA_REFRESHING_TIMEOUT, refresh_task)
534-
.await
535-
.map_err(|_e| {
536-
ErrorCode::RefreshTableInfoFailure(format!(
537-
"failed to refresh table info {} in time",
538-
table_description
539-
))
540-
})
541-
.map_err(|e| {
542-
ErrorCode::RefreshTableInfoFailure(format!(
543-
"failed to refresh table info {} : {}",
544-
table_description, e
545-
))
546-
})?
547-
};
548-
549-
GlobalIORuntime::instance().block_on(refresh_task_with_timeout)
528+
GlobalIORuntime::instance().block_on(refresh_task)
550529
}
551530

552531
fn refresh_table_info(
@@ -571,8 +550,7 @@ impl FuseTable {
571550
table_info.ident
572551
);
573552

574-
let snapshot_hint =
575-
Self::refresh_schema_from_hint(operator, storage_prefix, &table_info.desc)?;
553+
let snapshot_hint = Self::refresh_schema_from_hint(operator, storage_prefix)?;
576554

577555
info!(
578556
"extracted snapshot location [{:?}] of table {}, with id {:?} from the last snapshot hint file.",

0 commit comments

Comments
 (0)