@@ -416,7 +416,9 @@ impl CheckpointControl {
416416 ) ;
417417 // Progress of independent checkpoint jobs
418418 for ( job_id, job) in & database_checkpoint_control. independent_checkpoint_job_controls {
419- progress. extend ( [ ( * job_id, job. gen_backfill_progress ( ) ) ] ) ;
419+ if let Some ( p) = job. gen_backfill_progress ( ) {
420+ progress. insert ( * job_id, p) ;
421+ }
420422 }
421423 }
422424 progress
@@ -896,22 +898,38 @@ impl DatabaseCheckpointControl {
896898 . first_inflight_barrier ( self . partial_graph_id )
897899 . map ( |epoch| epoch. prev ) ;
898900 for ( job_id, job) in & mut self . independent_checkpoint_job_controls {
899- let IndependentCheckpointJobControl :: CreatingStreamingJob ( job) = job;
900- if let Some ( ( epoch, resps, info, is_finish_epoch) ) = job. start_completing (
901- partial_graph_manager,
902- min_upstream_inflight_barrier,
903- committed_epoch,
904- ) {
905- let resps = resps. into_values ( ) . collect_vec ( ) ;
906- if is_finish_epoch {
907- assert ! ( info. notifiers. is_empty( ) ) ;
908- finished_jobs. push ( ( * job_id, epoch, resps) ) ;
909- continue ;
910- } ;
911- independent_jobs_task. push ( ( * job_id, epoch, resps, info) ) ;
901+ match job {
902+ IndependentCheckpointJobControl :: CreatingStreamingJob ( creating_job) => {
903+ if let Some ( ( epoch, resps, info, is_finish_epoch) ) = creating_job
904+ . start_completing (
905+ partial_graph_manager,
906+ min_upstream_inflight_barrier,
907+ committed_epoch,
908+ )
909+ {
910+ let resps = resps. into_values ( ) . collect_vec ( ) ;
911+ if is_finish_epoch {
912+ assert ! ( info. notifiers. is_empty( ) ) ;
913+ finished_jobs. push ( ( * job_id, epoch, resps) ) ;
914+ continue ;
915+ } ;
916+ independent_jobs_task. push ( ( * job_id, epoch, resps, info) ) ;
917+ }
918+ }
919+ IndependentCheckpointJobControl :: BatchRefresh ( batch_refresh_job) => {
920+ if let Some ( ( epoch, resps, info, tracking_job) ) =
921+ batch_refresh_job. start_completing ( partial_graph_manager)
922+ {
923+ let resps = resps. into_values ( ) . collect_vec ( ) ;
924+ if let Some ( tracking_job) = tracking_job {
925+ let task = task. get_or_insert_default ( ) ;
926+ task. finished_jobs . push ( tracking_job) ;
927+ }
928+ independent_jobs_task. push ( ( * job_id, epoch, resps, info) ) ;
929+ }
930+ }
912931 }
913932 }
914-
915933 if !finished_jobs. is_empty ( ) {
916934 partial_graph_manager. remove_partial_graphs (
917935 finished_jobs
@@ -924,10 +942,12 @@ impl DatabaseCheckpointControl {
924942 debug ! ( epoch, %job_id, "finish creating job" ) ;
925943 // It's safe to remove the creating job, because on CompleteJobType::Finished,
926944 // all previous barriers have been collected and completed.
927- let IndependentCheckpointJobControl :: CreatingStreamingJob ( creating_streaming_job) =
928- self . independent_checkpoint_job_controls
929- . remove ( & job_id)
930- . expect ( "should exist" ) ;
945+ let Some ( IndependentCheckpointJobControl :: CreatingStreamingJob (
946+ creating_streaming_job,
947+ ) ) = self . independent_checkpoint_job_controls . remove ( & job_id)
948+ else {
949+ panic ! ( "finished job {job_id} should be a creating streaming job" ) ;
950+ } ;
931951 let tracking_job = creating_streaming_job. into_tracking_job ( ) ;
932952 self . finishing_jobs_collector
933953 . collect ( epoch, job_id, ( resps, tracking_job) ) ;
@@ -1213,7 +1233,8 @@ impl DatabaseCheckpointControl {
12131233 } ;
12141234
12151235 if let Some ( Command :: CreateStreamingJob {
1216- job_type : CreateStreamingJobType :: SnapshotBackfill ( _) ,
1236+ job_type :
1237+ CreateStreamingJobType :: SnapshotBackfill ( _) | CreateStreamingJobType :: BatchRefresh ( _) ,
12171238 ..
12181239 } ) = & command
12191240 && self . state . is_paused ( )
0 commit comments