@@ -13,6 +13,7 @@ import (
1313
1414 "github.com/cockroachdb/cockroach/pkg/ccl/changefeedccl/cdceval"
1515 "github.com/cockroachdb/cockroach/pkg/ccl/changefeedccl/changefeedbase"
16+ "github.com/cockroachdb/cockroach/pkg/ccl/changefeedccl/changefeedpb"
1617 "github.com/cockroachdb/cockroach/pkg/ccl/kvccl/kvfollowerreadsccl"
1718 "github.com/cockroachdb/cockroach/pkg/clusterversion"
1819 "github.com/cockroachdb/cockroach/pkg/jobs/jobspb"
@@ -470,6 +471,20 @@ func makePlan(
470471 }
471472 }
472473
474+ var resolvedTables * changefeedpb.ResolvedTables
475+ if progressConfig != nil && progressConfig .PerTableTracking {
476+ var rt changefeedpb.ResolvedTables
477+ if err := execCtx .ExecCfg ().InternalDB .Txn (ctx , func (ctx context.Context , txn isql.Txn ) error {
478+ return readChangefeedJobInfo (ctx , resolvedTablesFilename , & rt , txn , jobID )
479+ }); err != nil {
480+ return nil , nil , err
481+ }
482+ resolvedTables = & rt
483+ if log .ExpensiveLogEnabled (ctx , 2 ) {
484+ log .Dev .Infof (ctx , "read resolved tables: %v" , resolvedTables )
485+ }
486+ }
487+
473488 aggregatorSpecs := make ([]* execinfrapb.ChangeAggregatorSpec , len (spanPartitions ))
474489 for i , sp := range spanPartitions {
475490 if log .ExpensiveLogEnabled (ctx , 2 ) {
@@ -493,6 +508,7 @@ func makePlan(
493508 Select : execinfrapb.Expression {Expr : details .Select },
494509 Description : description ,
495510 ProgressConfig : progressConfig ,
511+ ResolvedTables : resolvedTables ,
496512 }
497513 }
498514
@@ -508,6 +524,7 @@ func makePlan(
508524 UserProto : execCtx .User ().EncodeProto (),
509525 Description : description ,
510526 ProgressConfig : progressConfig ,
527+ ResolvedTables : resolvedTables ,
511528 }
512529
513530 if haveKnobs && maybeCfKnobs .OnDistflowSpec != nil {
0 commit comments