Skip to content

Commit

Permalink
Merge #118421
Browse files Browse the repository at this point in the history
118421: changefeedccl: match nil metrics behaviour r=miretskiy a=wenyihu6

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, #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: #117693 
Release note: none
Epic: none


Co-authored-by: Wenyi Hu <[email protected]>
  • Loading branch information
craig[bot] and wenyihu6 committed Jan 30, 2024
2 parents cdd6cae + 7c05a07 commit 815e757
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 815e757

Please sign in to comment.