Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
chenzl25 committed Jan 5, 2024
1 parent 3afd98a commit 0b055d6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/frontend/src/scheduler/distributed/stage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -705,7 +705,9 @@ impl StageRunner {
.worker_node_manager
.manager
.get_workers_by_parallel_unit_ids(&parallel_unit_ids)?;

if candidates.is_empty() {
return Err(SchedulerError::EmptyWorkerNodes);
}
return Ok(Some(
candidates
.get(self.stage.session_id.0 as usize % candidates.len())
Expand Down Expand Up @@ -736,6 +738,9 @@ impl StageRunner {
.worker_node_manager
.manager
.get_workers_by_parallel_unit_ids(&[pu])?;
if candidates.is_empty() {
return Err(SchedulerError::EmptyWorkerNodes);
}
Ok(Some(candidates[0].clone()))
} else {
Ok(None)
Expand Down
3 changes: 3 additions & 0 deletions src/frontend/src/scheduler/local.rs
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,9 @@ impl LocalQueryExecution {
.worker_node_manager
.manager
.get_workers_by_parallel_unit_ids(&parallel_unit_ids)?;
if candidates.is_empty() {
return Err(SchedulerError::EmptyWorkerNodes);
}
candidates
.get(stage.session_id.0 as usize % candidates.len())
.context("no available worker node for dml")?
Expand Down

0 comments on commit 0b055d6

Please sign in to comment.