-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
changefeedccl: allow users to alter the sink URI of an existing changefeed #77043
changefeedccl: allow users to alter the sink URI of an existing changefeed #77043
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 3 files at r1.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @HonoreDB and @sherman-grewal)
pkg/ccl/changefeedccl/alter_changefeed_stmt.go, line 181 at r1 (raw file):
} if key == changefeedbase.OptSink { newChangefeedStmt.SinkURI = tree.NewDString(value)
This PR is very nice; consider augmenting this logic so that if
newURI scheme differs from old url scheme, then you wipe all of the previously specified sink specific options.
4c16a01
to
730e010
Compare
an existing changefeed In this PR, we introduce the capability to alter the sink URI of an existing changefeed. This can be achieved by executing the following statement: ALTER CHANGEFEED <job_id> SET sink = '<sink_uri>' Note that the sink type cannot be altered. That is, the sink type must be the same type that was chosen when the changefeed was initially created. Release note (enterprise change): Users may now alter the sink URI of an existing changefeed. This can be achieved by executing the following statement: ALTER CHANGEFEED <job_id> SET sink = '<sink_uri>' Where the sink type of the new sink must match the sink type of the old sink that was chosen at the creation of the changefeed.
730e010
to
067f213
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @HonoreDB and @miretskiy)
pkg/ccl/changefeedccl/alter_changefeed_stmt.go, line 181 at r1 (raw file):
Previously, miretskiy (Yevgeniy Miretskiy) wrote…
This PR is very nice; consider augmenting this logic so that if
newURI scheme differs from old url scheme, then you wipe all of the previously specified sink specific options.
As discussed offline, we will be disallowing users to alter changefeed schemes for now. When this option becomes available to users, we will keep this in mind.
bors r+ |
Build failed: |
bors r+ |
Build succeeded: |
if newSinkURI.Scheme != prevSinkURI.Scheme { | ||
return pgerror.Newf( | ||
pgcode.InvalidParameterValue, | ||
`new sink type %q does not match original sink type %q, sink type cannot be altered`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It’d be nice to make it a little more prescriptive, so the user knows what to do next. something like ‘changing the type of a changefeed (in this case %q to %q) is disallowed. use CREATE CHANGEFEED instead.'
changefeedccl: allow users to alter the sink URI of
an existing changefeed
References #75895
In this PR, we introduce the capability to alter
the sink URI of an existing changefeed. This
can be achieved by executing the following
statement:
ALTER CHANGEFEED <job_id> SET sink = '<sink_uri>'
Note that the sink type cannot be altered. That is,
the sink type must be the same type that was chosen
when the changefeed was initially created.
Release note (enterprise change): Users may now alter
the sink URI of an existing changefeed. This can be
achieved by executing the following statement:
ALTER CHANGEFEED <job_id> SET sink = '<sink_uri>'
Where the sink type of the new sink must match the
sink type of the old sink that was chosen at the
creation of the changefeed.