@@ -159,9 +159,7 @@ impl Coordinator {
159159 let mut sources_to_drop = vec ! [ ] ;
160160 let mut replication_slots_to_drop: Vec < ( PostgresConnection , String ) > = vec ! [ ] ;
161161 let mut storage_sink_gids_to_drop = vec ! [ ] ;
162- let mut indexes_to_drop = vec ! [ ] ;
163- let mut materialized_views_to_drop = vec ! [ ] ;
164- let mut continual_tasks_to_drop = vec ! [ ] ;
162+ let mut compute_gids_to_drop = vec ! [ ] ;
165163 let mut view_gids_to_drop = vec ! [ ] ;
166164 let mut secrets_to_drop = vec ! [ ] ;
167165 let mut vpc_endpoints_to_drop = vec ! [ ] ;
@@ -305,7 +303,7 @@ impl Coordinator {
305303 ) ;
306304 }
307305 CatalogImplication :: Index ( CatalogImplicationKind :: Dropped ( index, full_name) ) => {
308- indexes_to_drop . push ( ( index. cluster_id , index. global_id ( ) ) ) ;
306+ compute_gids_to_drop . push ( ( index. cluster_id , index. global_id ( ) ) ) ;
309307 dropped_item_names. insert ( index. global_id ( ) , full_name) ;
310308 }
311309 CatalogImplication :: MaterializedView ( CatalogImplicationKind :: Added ( mv) ) => {
@@ -325,7 +323,8 @@ impl Coordinator {
325323 mv,
326324 full_name,
327325 ) ) => {
328- materialized_views_to_drop. push ( ( mv. cluster_id , mv. global_id_writes ( ) ) ) ;
326+ compute_gids_to_drop. push ( ( mv. cluster_id , mv. global_id_writes ( ) ) ) ;
327+ sources_to_drop. extend ( mv. global_ids ( ) . map ( |gid| ( catalog_id, gid) ) ) ;
329328 dropped_item_names. insert ( mv. global_id_writes ( ) , full_name) ;
330329 }
331330 CatalogImplication :: View ( CatalogImplicationKind :: Added ( view) ) => {
@@ -358,7 +357,8 @@ impl Coordinator {
358357 ct,
359358 _full_name,
360359 ) ) => {
361- continual_tasks_to_drop. push ( ( catalog_id, ct. cluster_id , ct. global_id ( ) ) ) ;
360+ compute_gids_to_drop. push ( ( ct. cluster_id , ct. global_id ( ) ) ) ;
361+ sources_to_drop. push ( ( catalog_id, ct. global_id ( ) ) ) ;
362362 }
363363 CatalogImplication :: Secret ( CatalogImplicationKind :: Added ( secret) ) => {
364364 tracing:: debug!( ?secret, "not handling AddSecret in here yet" ) ;
@@ -524,9 +524,7 @@ impl Coordinator {
524524 . map ( |( _, gid) | * gid)
525525 . chain ( tables_to_drop. iter ( ) . map ( |( _, gid) | * gid) )
526526 . chain ( storage_sink_gids_to_drop. iter ( ) . copied ( ) )
527- . chain ( indexes_to_drop. iter ( ) . map ( |( _, id) | * id) )
528- . chain ( materialized_views_to_drop. iter ( ) . map ( |( _, id) | * id) )
529- . chain ( continual_tasks_to_drop. iter ( ) . map ( |( _, _, gid) | * gid) )
527+ . chain ( compute_gids_to_drop. iter ( ) . map ( |( _, gid) | * gid) )
530528 . chain ( view_gids_to_drop. iter ( ) . copied ( ) )
531529 . collect ( ) ;
532530
@@ -592,27 +590,14 @@ impl Coordinator {
592590 }
593591 }
594592
595- let storage_ids_to_drop : BTreeSet < _ > = sources_to_drop
593+ let storage_gids_to_drop : BTreeSet < _ > = sources_to_drop
596594 . iter ( )
597595 . map ( |( _id, gid) | gid)
598596 . chain ( storage_sink_gids_to_drop. iter ( ) )
599597 . chain ( tables_to_drop. iter ( ) . map ( |( _id, gid) | gid) )
600- . chain ( materialized_views_to_drop. iter ( ) . map ( |( _, id) | id) )
601- . chain ( continual_tasks_to_drop. iter ( ) . map ( |( _, _, gid) | gid) )
602598 . copied ( )
603599 . collect ( ) ;
604600
605- let compute_ids_to_drop: BTreeSet < _ > = indexes_to_drop
606- . iter ( )
607- . copied ( )
608- . chain ( materialized_views_to_drop. iter ( ) . copied ( ) )
609- . chain (
610- continual_tasks_to_drop
611- . iter ( )
612- . map ( |( _, cluster_id, gid) | ( * cluster_id, * gid) ) ,
613- )
614- . collect ( ) ;
615-
616601 // Gather resources that we have to remove from timeline state and
617602 // pre-check if any Timelines become empty, when we drop the specified
618603 // storage and compute resources.
@@ -624,13 +609,13 @@ impl Coordinator {
624609 let mut id_bundle = CollectionIdBundle :: default ( ) ;
625610
626611 for storage_id in read_holds. storage_ids ( ) {
627- if storage_ids_to_drop . contains ( & storage_id) {
612+ if storage_gids_to_drop . contains ( & storage_id) {
628613 id_bundle. storage_ids . insert ( storage_id) ;
629614 }
630615 }
631616
632617 for ( instance_id, id) in read_holds. compute_ids ( ) {
633- if compute_ids_to_drop . contains ( & ( instance_id, id) )
618+ if compute_gids_to_drop . contains ( & ( instance_id, id) )
634619 || clusters_to_drop. contains ( & instance_id)
635620 {
636621 id_bundle
@@ -713,16 +698,8 @@ impl Coordinator {
713698 }
714699 }
715700
716- if !indexes_to_drop. is_empty ( ) {
717- self . drop_indexes ( indexes_to_drop) ;
718- }
719-
720- if !materialized_views_to_drop. is_empty ( ) {
721- self . drop_materialized_views ( materialized_views_to_drop) ;
722- }
723-
724- if !continual_tasks_to_drop. is_empty ( ) {
725- self . drop_continual_tasks ( continual_tasks_to_drop) ;
701+ if !compute_gids_to_drop. is_empty ( ) {
702+ self . drop_compute_collections ( compute_gids_to_drop) ;
726703 }
727704
728705 if !vpc_endpoints_to_drop. is_empty ( ) {
0 commit comments