diff --git a/src/mito2/src/read/scan_util.rs b/src/mito2/src/read/scan_util.rs index 8e19dff5cf..385f6fa4b5 100644 --- a/src/mito2/src/read/scan_util.rs +++ b/src/mito2/src/read/scan_util.rs @@ -23,6 +23,7 @@ use futures::Stream; use prometheus::IntGauge; use snafu::ResultExt; use store_api::storage::RegionId; +use tokio::task::yield_now; use crate::error::{Result, TimeoutSnafu}; use crate::metrics::SCAN_PARTITION; @@ -218,6 +219,10 @@ pub(crate) fn scan_file_ranges( // .build_file_ranges(index, read_type, &mut reader_metrics) // .await?; part_metrics.inc_num_file_ranges(ranges.len()); + + // Notify other partitions. + yield_now().await; + if read_type == "unordered_scan_files" { common_telemetry::debug!( "[DEBUG_SCAN] Thread: {:?}, Scan file ranges build ranges end, region_id: {}, partition: {}, index: {:?}, ranges: {}",