cockroach icon indicating copy to clipboard operation
cockroach copied to clipboard

cdc: separate schema and topic prefix for changefeed namespace

Open amruss opened this issue 6 years ago • 2 comments

Is your feature request related to a problem? Please describe. When one kafka cluster is used for many changefeeds, with the same table name, the client cannot differentiate between changefeeds.

Describe the solution you'd like Change the namespace of the changefeed for the schema and topic. Add a flag (WITH option) where we’ll use fully qualified name (topic+schema) for given table rather than just table name. Default behavior is just table name.

Describe alternatives you've considered Should add schema prefix OR topic prefix as schema name -- fine with either Either:

  • Prefix the schema namespace with what we use for topic namespace, or
  • User can specify prefix used in both

Additional context Could also solve https://github.com/cockroachdb/cockroach/issues/28670

amruss avatar Oct 27 '20 19:10 amruss

Hi @amruss, I've guessed the C-ategory of your issue and suitably labeled it. Please re-label if inaccurate.

While you're here, please consider adding an A- label to help keep our repository tidy.

:owl: Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan.

blathers-crl avatar Oct 27 '20 19:10 blathers-crl

Options for command UX

Option 1 CREATE CHANGEFEED FOR INTO ‘kafka://endpoint?topic_prefix=X&schema_prefix=Y’ WITH fully_qualified_name

Schema namespace: <schema_prefix>..<database_schema>.<table_name>

Topic namespace: <topic_prefix>..<database_schema>.<table_name>

Option 2 CREATE CHANGEFEED FOR INTO ‘kafka://endpoint?topic_prefix=X’ WITH fully_qualified_name

Schema namespace: <topic_prefix>..<database_schema>.<table_name>

Topic namespace: <topic_prefix>..<database_schema>.<table_name>

Option 3 CREATE CHANGEFEED FOR INTO ‘kafka://endpoint?topic_prefix=X&schema_prefix=topic_prefix’ WITH fully_qualified_name

Schema namespace: <schema_prefix>..<database_schema>.<table_name>

Topic namespace: <topic_prefix>..<database_schema>.<table_name>

Option 4 CREATE CHANGEFEED FOR INTO ‘kafka://endpoint?topic_and_schema_prefix=X’ WITH fully_qualified_name

Schema namespace: <topic_and_schema_prefix>..<database_schema>.<table_name>

Topic namespace: <topic_and_schema_prefix>..<database_schema>.<table_name>

amruss avatar Nov 02 '20 21:11 amruss