@@ -104,7 +104,7 @@ use mz_catalog::memory::objects::{
104104} ;
105105use mz_cloud_resources:: { CloudResourceController , VpcEndpointConfig , VpcEndpointEvent } ;
106106use mz_compute_client:: as_of_selection;
107- use mz_compute_client:: controller:: error:: InstanceMissing ;
107+ use mz_compute_client:: controller:: error:: { DataflowCreationError , InstanceMissing } ;
108108use mz_compute_types:: ComputeInstanceId ;
109109use mz_compute_types:: dataflows:: DataflowDescription ;
110110use mz_compute_types:: plan:: Plan ;
@@ -3682,23 +3682,41 @@ impl Coordinator {
36823682
36833683 /// Call into the compute controller to install a finalized dataflow, and
36843684 /// initialize the read policies for its exported readable objects.
3685+ ///
3686+ /// # Panics
3687+ ///
3688+ /// Panics if dataflow creation fails.
36853689 pub ( crate ) async fn ship_dataflow (
36863690 & mut self ,
36873691 dataflow : DataflowDescription < Plan > ,
36883692 instance : ComputeInstanceId ,
36893693 subscribe_target_replica : Option < ReplicaId > ,
36903694 ) {
3695+ self . ship_dataflow_fallible ( dataflow, instance, subscribe_target_replica)
3696+ . await
3697+ . unwrap_or_terminate ( "dataflow creation cannot fail" ) ;
3698+ }
3699+
3700+ /// Call into the compute controller to install a finalized dataflow, and
3701+ /// initialize the read policies for its exported readable objects.
3702+ pub ( crate ) async fn ship_dataflow_fallible (
3703+ & mut self ,
3704+ dataflow : DataflowDescription < Plan > ,
3705+ instance : ComputeInstanceId ,
3706+ subscribe_target_replica : Option < ReplicaId > ,
3707+ ) -> Result < ( ) , DataflowCreationError > {
36913708 // We must only install read policies for indexes, not for sinks.
36923709 // Sinks are write-only compute collections that don't have read policies.
36933710 let export_ids = dataflow. exported_index_ids ( ) . collect ( ) ;
36943711
36953712 self . controller
36963713 . compute
3697- . create_dataflow ( instance, dataflow, subscribe_target_replica)
3698- . unwrap_or_terminate ( "dataflow creation cannot fail" ) ;
3714+ . create_dataflow ( instance, dataflow, subscribe_target_replica) ?;
36993715
37003716 self . initialize_compute_read_policies ( export_ids, instance, CompactionWindow :: Default )
37013717 . await ;
3718+
3719+ Ok ( ( ) )
37023720 }
37033721
37043722 /// Call into the compute controller to allow writes to the specified IDs
0 commit comments