Skip to content
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

cdc: UX consistency for changefeeds, like other database objects #93459

Open
shermanCRL opened this issue Dec 12, 2022 · 2 comments
Open

cdc: UX consistency for changefeeds, like other database objects #93459

shermanCRL opened this issue Dec 12, 2022 · 2 comments
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

Comments

@shermanCRL
Copy link
Contributor

shermanCRL commented Dec 12, 2022

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

@shermanCRL shermanCRL added C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) E-starter Might be suitable for a starter project for new employees or team members. A-cdc Change Data Capture E-quick-win Likely to be a quick win for someone experienced. labels Dec 12, 2022
@blathers-crl blathers-crl bot added the T-cdc label Dec 12, 2022
@blathers-crl
Copy link

blathers-crl bot commented Dec 12, 2022

cc @cockroachdb/cdc

@blathers-crl blathers-crl bot added this to Triage in [DEPRECATED] CDC Dec 12, 2022
@amruss amruss moved this from Triage to UX improvements in [DEPRECATED] CDC Dec 21, 2022
@shermanCRL shermanCRL changed the title cdc: syntactic sugar for changefeeds as first-class citizens cdc: syntactic sugar (consistency) for changefeeds as first-class citizens Jan 9, 2023
@surahman
Copy link
Contributor

I am trying to get back into contributing to OSS with CRDB. Golang (😄) + DB (😄) = 😁

Could I please get some context on this issue - what is the plan of action here? I have been out of the CRDB codebase for a while. Is this issue time critical?

@shermanCRL shermanCRL changed the title cdc: syntactic sugar (consistency) for changefeeds as first-class citizens cdc: named changefeeds Jan 14, 2023
@shermanCRL shermanCRL changed the title cdc: named changefeeds cdc: UX consistency for changefeeds, like other database objects Jan 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
[DEPRECATED] CDC
  
UX improvements
Development

No branches or pull requests

2 participants