Skip to content

changefeedccl: detect sink URLs with no scheme#68978

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
stevendanna:ssd/no-assume-buffersink
Aug 16, 2021
Merged

changefeedccl: detect sink URLs with no scheme#68978
craig[bot] merged 1 commit intocockroachdb:masterfrom
stevendanna:ssd/no-assume-buffersink

Conversation

@stevendanna
Copy link
Copy Markdown
Collaborator

Previously, if a user provided a sink URL with no scheme (such as
kafka%3A%2F%2Fnope%0A), a changefeed job would be started. However,
this changefeed job would be writing into a bufferSink. The
bufferSink is used by core changefeeds.

The user may have provided such a URL because of confusion over how to
URL encode their sink URL.

Now, they will receive an error such as

pq: no scheme found for sink URL "kafka%3A%2F%2Fnope%0A"

Release note (enterprise change): CHANGEFEED statements now error
if the provided sink URL does not contain a scheme. Such URLs are
typically a mistake and will result in non-functional changefeeds.

Previously, if a user provided a sink URL with no scheme (such as
` kafka%3A%2F%2Fnope%0A`), a changefeed job would be started. However,
this changefeed job would be writing into a bufferSink.  The
bufferSink is used by core changefeeds.

The user may have provided such a URL because of confusion over how to
URL encode their sink URL.

Now, they will receive an error such as

```
pq: no scheme found for sink URL "kafka%3A%2F%2Fnope%0A"
```

Release note (enterprise change): CHANGEFEED statements now error
if the provided sink URL does not contain a scheme. Such URLs are
typically a mistake and will result in non-functional changefeeds.
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

@stevendanna stevendanna requested a review from HonoreDB August 16, 2021 09:24
Copy link
Copy Markdown
Contributor

@HonoreDB HonoreDB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @stevendanna)


pkg/ccl/changefeedccl/sink.go, line 82 at r1 (raw file):

	newSink := func() (Sink, error) {
		if feedCfg.SinkURI == "" {

Ah, that explains where this came from.

@stevendanna
Copy link
Copy Markdown
Collaborator Author

bors r=HonoreDB

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Aug 16, 2021

Build succeeded:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants