Skip to content

Commit

Permalink
changefeedccl: match nil metrics behaviour
Browse files Browse the repository at this point in the history
Previously, `validateExternalConnectionSinkURI` would validate the changefeed
sink URI by creating a fake sink and passing `nil` for `metricsRecorder`. This
is usually not problematic since the sink is never used. A new patch, cockroachdb#117693,
is now changing this and calling `metricsBuilder` interface method inside
`makeKafkaSink`. To resolve this, this patch changes getSink in
`validateExternalConnectionSinkURI` to pass in `(*sliMetrics)(nil)` to avoid
calling methods on a nil interface.

See also: cockroachdb#117693
Release note: none
Epic: none
  • Loading branch information
wenyihu6 committed Jan 30, 2024
1 parent 0cb4b7e commit 7c05a07
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/ccl/changefeedccl/sink_external_connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func validateExternalConnectionSinkURI(
// TODO(adityamaru): When we add `CREATE EXTERNAL CONNECTION ... WITH` support
// to accept JSONConfig we should validate that here too.
_, err := getSink(ctx, serverCfg, jobspb.ChangefeedDetails{SinkURI: uri}, nil, env.Username,
jobspb.JobID(0), nil)
jobspb.JobID(0), (*sliMetrics)(nil))
if err != nil {
return errors.Wrap(err, "invalid changefeed sink URI")
}
Expand Down

0 comments on commit 7c05a07

Please sign in to comment.