Skip to content

Commit bb757f5

Browse files
committed
fix: retain leaf diagnostics before checking composed accuracy
1 parent 372350b commit bb757f5

1 file changed

Lines changed: 20 additions & 19 deletions

File tree

‎control_plane/src/physical/compiler.rs‎

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4014,25 +4014,6 @@ fn reject_uncertified_readouts(
40144014
reason: format!("invalid executable subDAG: {error}"),
40154015
}
40164016
})?;
4017-
// Leaf guarantees do not certify a composition (for example, division of
4018-
// two approximate quantiles). Admission checks the complete query result.
4019-
if dag.nodes.iter().any(|node| {
4020-
matches!(
4021-
node.payload,
4022-
planner_types::post_asap::ExecutableOperatorPayload::SummaryEstimate { .. }
4023-
)
4024-
}) && root.guarantee.as_ref().is_none_or(|guarantee| {
4025-
!asap_aware_mapping::accuracy::AccuracyModel::satisfies(
4026-
&DefaultAccuracyModel,
4027-
guarantee,
4028-
accuracy,
4029-
)
4030-
}) {
4031-
return Err(CompileError::Query {
4032-
query_id: query_id.into(),
4033-
reason: "selected query result has no certified accuracy guarantee satisfying the requested accuracy".into(),
4034-
});
4035-
}
40364017
for node in &dag.nodes {
40374018
if target != PhysicalDeploymentTarget::BackendLocalRemoteWrite
40384019
&& node.guarantee.as_ref().is_some_and(|guarantee| {
@@ -4063,6 +4044,25 @@ fn reject_uncertified_readouts(
40634044
});
40644045
}
40654046
}
4047+
// Leaf guarantees do not certify a composition (for example, division of
4048+
// two approximate quantiles). Admission checks the complete query result.
4049+
if dag.nodes.iter().any(|node| {
4050+
matches!(
4051+
node.payload,
4052+
planner_types::post_asap::ExecutableOperatorPayload::SummaryEstimate { .. }
4053+
)
4054+
}) && root.guarantee.as_ref().is_none_or(|guarantee| {
4055+
!asap_aware_mapping::accuracy::AccuracyModel::satisfies(
4056+
&asap_aware_mapping::DefaultAccuracyModel,
4057+
guarantee,
4058+
accuracy,
4059+
)
4060+
}) {
4061+
return Err(CompileError::Query {
4062+
query_id: query_id.into(),
4063+
reason: "selected query result has no certified accuracy guarantee satisfying the requested accuracy".into(),
4064+
});
4065+
}
40664066
Ok(())
40674067
}
40684068

@@ -5870,6 +5870,7 @@ pub(crate) mod tests {
58705870
let error = reject_uncertified_readouts(
58715871
"q",
58725872
&request.queries[0].selected_plan_root,
5873+
&request.queries[0].accuracy_target,
58735874
PhysicalDeploymentTarget::DistributedCollectors,
58745875
)
58755876
.unwrap_err();

0 commit comments

Comments
 (0)