cdc: UX consistency for changefeeds, like other database objects #93459
Labels
A-cdc
Change Data Capture
C-enhancement
Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)
E-quick-win
Likely to be a quick win for someone experienced.
E-starter
Might be suitable for a starter project for new employees or team members.
T-cdc
Changefeeds are “just” jobs, they are not an entity on the order of tables or indexes. While there is deeper work we could do for changefeeds to have descriptors, etc, we can add some UX in the short term to give changefeeds syntactic consistency with tables, indexes, etc. To be clear, changefeeds remain jobs, this is all UX.
CREATE CHANGEFEED opt_name FOR TABLE
...opt_name
is new. Presumably stored in the job protobuf. We might follow the naming logic for indexes, where the name is optional and gets auto-created if not specified. If so, need a migration.ALTER CHANGEFEED <name> RENAME TO <name>
Hmm, this already uses Job ID.
SHOW CHANGEFEEDS
An alias to
SHOW CHANGEFEED JOBS
, new column for name. Hide Job ID?DROP CHANGEFEED <name>
Calls
CANCEL JOB
. Returns error if the specified name is not a changefeed job.DROP ALL CHANGEFEEDS
Alias for
CANCEL ALL CHANGEFEED JOBS
PAUSE CHANGEFEED <name>
Calls
PAUSE JOB
. Returns error if the specified name is not a changefeed job.PAUSE ALL CHANGEFEEDS
Alias for
PAUSE ALL CHANGEFEED JOBS
RESUME CHANGEFEED <name>
Calls
RESUME JOB
. Returns error if the specified name is not a changefeed job.RESUME ALL CHANGEFEEDS
Alias for
RESUME ALL CHANGEFEED JOBS
SHOW CREATE CHANGEFEED <name>
See also cdc: create changefeed from previous changefeed #69348
Proposed: for clarity, these new commands should only accept a name and not a job_id. If you want to operate with job_id's, use the existing syntax (which we will not deprecate). Alternatively, can we handle either a name or job_id without ambiguity or surprises? Or, should we not bother with their naming part and just use the following sugar with job_id?
We’d want to take care to do this in a way that we won’t regret in the future, by painting ourselves into a syntactic or semantic corner. Likely low-risk.
Jira issue: CRDB-22346
Epic CRDB-25041
The text was updated successfully, but these errors were encountered: