Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions asap-query-engine/src/bin/precompute_engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,13 @@ async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
// it the handler falls back to the streaming-config single
// axis (which always defaults to `SketchWarmTier`) and the
// `EngineRouter` is effectively bypassed.
if let Some(routing_path) = args.backend_storage_routing.as_deref() {
// Phase α (MVP): always install a hot-reload routing handle —
// bootstrap from YAML when available, an empty table otherwise.
// The `POST /api/v1/storage_routing` endpoint can then swap in
// a controller-emitted table at runtime without restart.
let bootstrap_routing = if let Some(routing_path) =
args.backend_storage_routing.as_deref()
{
match query_engine_rust::data_model::BackendStorageRouting::from_yaml_file(
routing_path,
) {
Expand All @@ -300,20 +306,23 @@ async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
routing.default_backend(),
routing.len(),
);
http_server = http_server.with_backend_storage_routing(Arc::new(routing));
routing
}
Err(e) => {
warn!(
"Failed to load backend-storage-routing from {:?}: {} — falling back to streaming-config single axis",
"Failed to load backend-storage-routing from {:?}: {} — installing an empty routing table; the controller's first POST /api/v1/storage_routing push will fill it",
routing_path, e,
);
query_engine_rust::data_model::BackendStorageRouting::empty()
}
}
} else {
info!(
"--backend-storage-routing not set — every query routes per the streaming-config single axis (typically `sketch_warm`)",
"--backend-storage-routing not set — installing an empty routing table; the controller's first POST /api/v1/storage_routing push will fill it",
);
}
query_engine_rust::data_model::BackendStorageRouting::empty()
};
http_server = http_server.with_backend_storage_routing(Arc::new(bootstrap_routing));

// Phase-5/6: register a `GorillaQueryEngine` for the cold
// archive tier when the operator has provisioned one via the
Expand Down
3 changes: 2 additions & 1 deletion asap-query-engine/src/data_model/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,6 @@ pub use traits::*;
// `crate::data_model::BackendStorageRouting` compiling for any
// transitive caller that hasn't been migrated yet.
pub use crate::routing::{
classify_query_shape, BackendStorageRouting, QueryShape, RoutingTarget,
classify_query_shape, BackendStorageRouting, HotReloadBackendStorageRouting,
QueryShape, RoutingTarget,
};
Loading