@@ -309,6 +309,7 @@ impl QueryServer {
309309 stream_name
310310 ) ;
311311
312+ // roll back the stream creation
312313 Self :: send_stream_rollback_request ( & url, ingester. clone ( ) ) . await ?;
313314 }
314315
@@ -322,6 +323,7 @@ impl QueryServer {
322323 Ok ( ( ) )
323324 }
324325
326+ /// get the cumulative stats from all ingesters
325327 pub async fn fetch_stats_from_ingesters (
326328 stream_name : & str ,
327329 ) -> Result < QueriedStats , StreamError > {
@@ -376,6 +378,7 @@ impl QueryServer {
376378 Ok ( stats)
377379 }
378380
381+ /// send a request to the ingester to fetch its stats
379382 async fn send_stats_request (
380383 url : & str ,
381384 ingester : IngesterMetadata ,
@@ -473,6 +476,7 @@ impl QueryServer {
473476 Ok ( ( ) )
474477 }
475478
479+ /// send a rollback request to all ingesters
476480 async fn send_stream_rollback_request (
477481 url : & str ,
478482 ingester : IngesterMetadata ,
@@ -489,6 +493,7 @@ impl QueryServer {
489493 . send ( )
490494 . await
491495 . map_err ( |err| {
496+ // log the error and return a custom error
492497 log:: error!(
493498 "Fatal: failed to rollback stream creation: {}\n Error: {:?}" ,
494499 ingester. domain_name,
@@ -503,6 +508,8 @@ impl QueryServer {
503508 }
504509 } ) ?;
505510
511+ // if the response is not successful, log the error and return a custom error
512+ // this could be a bit too much, but we need to be sure it covers all cases
506513 if !resp. status ( ) . is_success ( ) {
507514 log:: error!(
508515 "failed to rollback stream creation: {}\n Response Returned: {:?}" ,
0 commit comments