Skip to content

Commit 9d097ec

Browse files
craig[bot]aerfrei
andcommitted
Merge #153009
153009: changefeedccl: fix unhandled error in enriched changefeed r=andyyang890,log-head a=aerfrei Previously we would supress this error potentially resulting in the source field of enriched changefeed messages not having the proper data and failing silently. Use a different function to avoid the error. Epic: none Release note: None Co-authored-by: Aerin Freilich <[email protected]>
2 parents 0ae31e5 + 7628e55 commit 9d097ec

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

pkg/ccl/changefeedccl/enriched_source_provider.go

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ package changefeedccl
77

88
import (
99
"context"
10-
"net"
1110
"net/url"
1211
"strings"
1312

@@ -96,7 +95,7 @@ func newEnrichedSourceData(
9695
sink sinkType,
9796
schemaInfo map[descpb.ID]tableSchemaInfo,
9897
) (enrichedSourceData, error) {
99-
var sourceNodeLocality, nodeName, nodeID string
98+
var sourceNodeLocality, nodeID string
10099
tiers := cfg.Locality.Tiers
101100

102101
nodeLocalities := make([]string, 0, len(tiers))
@@ -115,10 +114,6 @@ func newEnrichedSourceData(
115114
if err != nil {
116115
return enrichedSourceData{}, err
117116
}
118-
host, _, err := net.SplitHostPort(parsedUrl.Host)
119-
if err == nil {
120-
nodeName = host
121-
}
122117

123118
if optionalNodeID, ok := nodeInfo.NodeID.OptionalNodeID(); ok {
124119
nodeID = optionalNodeID.String()
@@ -131,7 +126,7 @@ func newEnrichedSourceData(
131126
clusterName: cfg.ExecutorConfig.(*sql.ExecutorConfig).RPCContext.ClusterName(),
132127
clusterID: nodeInfo.LogicalClusterID().String(),
133128
sourceNodeLocality: sourceNodeLocality,
134-
nodeName: nodeName,
129+
nodeName: parsedUrl.Hostname(),
135130
nodeID: nodeID,
136131
tableSchemaInfo: schemaInfo,
137132
}, nil

0 commit comments

Comments
 (0)