Skip to content

Commit 1d50e92

Browse files
committed
changefeedccl: don't save distsql diagram for core changefeeds
We can't save the DistSQL diagram since we are not a job. Fixes: #156789 Release note: none
1 parent 00ea203 commit 1d50e92

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

pkg/ccl/changefeedccl/changefeed_dist.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,7 @@ func startDistChangefeed(
313313
defer recv.Release()
314314

315315
var finishedSetupFn func(flowinfra.Flow)
316+
316317
if details.SinkURI != `` {
317318
// We abuse the job's results channel to make CREATE CHANGEFEED wait for
318319
// this before returning to the user to ensure the setup went okay. Job
@@ -322,9 +323,11 @@ func startDistChangefeed(
322323
// returned by resumed jobs, then it breaks instead of returning
323324
// nonsense.
324325
finishedSetupFn = func(flowinfra.Flow) { resultsCh <- tree.Datums(nil) }
325-
}
326326

327-
jobsprofiler.StorePlanDiagram(ctx, execCfg.DistSQLSrv.Stopper, p, execCfg.InternalDB, jobID)
327+
// We only store the plan diagram for changefeeds that have a sink since
328+
// sinkless changefeed don't have a job record.
329+
jobsprofiler.StorePlanDiagram(ctx, execCfg.DistSQLSrv.Stopper, p, execCfg.InternalDB, jobID)
330+
}
328331

329332
// Make sure to use special changefeed monitor going forward as the
330333
// parent monitor for the DistSQL infrastructure. This is needed to

0 commit comments

Comments
 (0)