@@ -54,8 +54,8 @@ use uuid::Uuid;
5454
5555use crate :: active_compute_sink:: { ActiveComputeSink , ActiveCopyTo } ;
5656use crate :: coord:: timestamp_selection:: TimestampDetermination ;
57- use crate :: query_tracker:: QueryTrackerCmd ;
5857use crate :: optimize:: OptimizerError ;
58+ use crate :: query_tracker:: QueryTrackerCmd ;
5959use crate :: statement_logging:: WatchSetCreation ;
6060use crate :: statement_logging:: { StatementEndedExecutionReason , StatementExecutionStrategy } ;
6161use crate :: util:: ResultExt ;
@@ -841,6 +841,7 @@ impl crate::coord::Coordinator {
841841 mz_compute_types:: dyncfgs:: PEEK_RESPONSE_STASH_READ_MEMORY_BUDGET_BYTES
842842 . get ( self . catalog ( ) . system_config ( ) . dyncfgs ( ) ) ;
843843
844+ let cluster_name = self . catalog ( ) . get_cluster ( compute_instance) . name . clone ( ) ;
844845 let peek_response_stream = Self :: create_peek_response_stream (
845846 rows_rx,
846847 finishing,
@@ -850,6 +851,10 @@ impl crate::coord::Coordinator {
850851 persist_client,
851852 peek_stash_read_batch_size_bytes,
852853 peek_stash_read_memory_budget_bytes,
854+ Some ( format ! (
855+ "query could not complete because cluster \" {}\" was dropped" ,
856+ cluster_name
857+ ) ) ,
853858 ) ;
854859
855860 Ok ( crate :: ExecuteResponse :: SendingRowsStreaming {
@@ -872,14 +877,19 @@ impl crate::coord::Coordinator {
872877 mut persist_client : mz_persist_client:: PersistClient ,
873878 peek_stash_read_batch_size_bytes : usize ,
874879 peek_stash_read_memory_budget_bytes : usize ,
880+ rows_rx_err : Option < String > ,
875881 ) -> impl futures:: Stream < Item = PeekResponseUnary > {
876882 async_stream:: stream!( {
877883 let result = rows_rx. await ;
878884
879885 let rows = match result {
880886 Ok ( rows) => rows,
881887 Err ( e) => {
882- yield PeekResponseUnary :: Error ( e. to_string( ) ) ;
888+ if let Some ( msg) = rows_rx_err {
889+ yield PeekResponseUnary :: Error ( msg) ;
890+ } else {
891+ yield PeekResponseUnary :: Error ( e. to_string( ) ) ;
892+ }
883893 return ;
884894 }
885895 } ;
0 commit comments