Skip to content

Commit 571dc70

Browse files
committed
merge: stack PR 749 on current PR 737 and main
2 parents f1a9a51 + 55e4780 commit 571dc70

5 files changed

Lines changed: 67 additions & 36 deletions

File tree

‎Cargo.lock‎

Lines changed: 36 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Cargo.toml‎

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ resolver = "2"
33
members = [
44
"crates/asap_otel_proto",
55
"crates/asap_types",
6-
"crates/asap_sketch_codec",
76
"data_plane",
87
"control_plane",
98
]
@@ -12,13 +11,19 @@ members = [
1211
edition = "2021"
1312
version = "0.1.0"
1413

14+
# ASAPCollector's `asap-precompute-rs` currently declares Sketchlib as a
15+
# relative path. When Collector is consumed from Git, resolve that dependency
16+
# to the same Git-sourced Sketchlib package as the backend.
17+
[patch."https://github.com/ProjectASAP/ASAPCollector"]
18+
asap_sketchlib = { git = "https://github.com/ProjectASAP/asap_sketchlib", branch = "main" }
19+
1520
[workspace.dependencies]
1621
# Keep Planner frontends, selection, and IR on the same immutable revision.
1722
# Alias upstream asap-types because this workspace also defines asap_types.
18-
planner-types = { package = "asap-types", git = "https://github.com/ProjectASAP/ASAPPlanner", rev = "851493116d42674d09cf9646dde59532003025e4" }
19-
asap-aware-mapping = { git = "https://github.com/ProjectASAP/ASAPPlanner", rev = "851493116d42674d09cf9646dde59532003025e4" }
20-
asap-frontend-promql = { git = "https://github.com/ProjectASAP/ASAPPlanner", rev = "851493116d42674d09cf9646dde59532003025e4" }
21-
asap-frontend-sql = { git = "https://github.com/ProjectASAP/ASAPPlanner", rev = "851493116d42674d09cf9646dde59532003025e4" }
23+
planner-types = { package = "asap-types", git = "https://github.com/ProjectASAP/ASAPPlanner", rev = "10d93846f0ef9f06ab19e599701d699d9cdd15af" }
24+
asap-aware-mapping = { git = "https://github.com/ProjectASAP/ASAPPlanner", rev = "10d93846f0ef9f06ab19e599701d699d9cdd15af" }
25+
asap-frontend-promql = { git = "https://github.com/ProjectASAP/ASAPPlanner", rev = "10d93846f0ef9f06ab19e599701d699d9cdd15af" }
26+
asap-frontend-sql = { git = "https://github.com/ProjectASAP/ASAPPlanner", rev = "10d93846f0ef9f06ab19e599701d699d9cdd15af" }
2227

2328
# Shared external deps (used by 2+ crates)
2429
serde = { version = "1.0", features = ["derive"] }

‎control_plane/src/physical/compiler/windows.rs‎

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -310,14 +310,27 @@ mod tests {
310310
base_pane_secs: 10,
311311
levels_secs: vec![30],
312312
};
313+
assert!(quote
314+
.layout
315+
.validate(quote.window_secs, quote.slide_secs)
316+
.is_ok());
317+
assert!(!supported(
318+
&quote,
319+
PhysicalDeploymentTarget::BackendLocalRemoteWrite
320+
));
313321
model.quotes = vec![quote];
314-
assert!(prepare_window_implementations(
322+
let error = prepare_window_implementations(
315323
&mut query,
316324
&model,
317325
PhysicalDeploymentTarget::BackendLocalRemoteWrite,
318-
0
326+
0,
319327
)
320-
.is_err());
328+
.unwrap_err();
329+
assert!(matches!(
330+
error,
331+
CompileError::Lifecycle { reason, .. }
332+
if reason.contains("does not match an executable state layout")
333+
));
321334
}
322335

323336
// Conflicting identities and repeated shape evidence must fail rather than silently lose an offer.

‎control_plane/src/planner_selection.rs‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ fn select_workload_impl(
399399
let selection = space.global_selection(cost_model);
400400
if let Some(trace) = trace.as_deref_mut() {
401401
let groups = space.cost_sorted(cost_model).iter().enumerate().map(|(index, group)| {
402-
let chosen = selection.groups().find(|selected| Rc::ptr_eq(selected.target, group.target))
402+
let chosen = selection.target_selections().find(|selected| Rc::ptr_eq(selected.target, group.target))
403403
.and_then(|selected| selected.chosen);
404404
let candidates = group.candidates.iter().zip(&group.costs).enumerate()
405405
.map(|(rank, (candidate, cost))| serde_json::json!({
@@ -418,8 +418,8 @@ fn select_workload_impl(
418418
"estimated_cost_status": if cost.is_finite() { "available" } else { "not_reported_by_cost_model" },
419419
"selected": chosen.is_some_and(|chosen| std::ptr::eq(chosen, *candidate)),
420420
})).collect::<Vec<_>>();
421-
let rejected = space.groups().find(|memo| Rc::ptr_eq(&memo.target, group.target))
422-
.into_iter().flat_map(|memo| &memo.rejected).map(|candidate| serde_json::json!({
421+
let rejected = space.target_subdag_candidates().find(|candidates| Rc::ptr_eq(&candidates.target, group.target))
422+
.into_iter().flat_map(|candidates| &candidates.rejected).map(|candidate| serde_json::json!({
423423
"status": "rejected", "strategy": candidate.strategy,
424424
"description": candidate.description, "reason": candidate.error.to_string()
425425
})).collect::<Vec<_>>();
@@ -434,7 +434,7 @@ fn select_workload_impl(
434434
.iter()
435435
.map(|(id, root)| {
436436
selection
437-
.materialize(root)
437+
.assemble_selected_dag(root)
438438
.map_err(|error| SelectionError::Workload(error.to_string()))?
439439
.map(|node| (*id, node))
440440
.ok_or_else(|| SelectionError::Workload(format!("missing query root {id}")))

‎crates/asap_types/src/executable_plan.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use serde::{Deserialize, Serialize};
2020
#[serde(transparent)]
2121
pub struct QueryNodeId(pub u64);
2222

23-
pub const OWNED_POST_ASAP_DAG_SCHEMA_VERSION: u32 = 1;
23+
pub const OWNED_POST_ASAP_DAG_SCHEMA_VERSION: u32 = 2;
2424
pub const MAINTENANCE_DAG_SCHEMA_VERSION: u32 = 2;
2525

2626
/// Versioned, language-neutral Planner DAG persisted with an installed plan.

0 commit comments

Comments
 (0)