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

kafka sink claim check functionality supports only deliver raw value to the external storage #11396

Closed
3AceShowHand opened this issue Jul 9, 2024 · 0 comments · Fixed by #11395
Assignees
Labels
area/ticdc Issues or PRs related to TiCDC. kafka type/feature Issues about a new feature

Comments

@3AceShowHand
Copy link
Contributor

3AceShowHand commented Jul 9, 2024

Is your feature request related to a problem?

TiCDC supports Kafka sink large message handle functionality since v7.4.0. There are two functionalities, the claim-check and the handle-key only.
If using the claim-check functionality, one Kafka message's key and value is encoded into JSON format, resulting in bytes, and then sent to the external storage systems.
For one kafka message, it has both key and value two parts, the key part is used to carry some metadata information to help the kafka producer and consumer handle the message. At the moment, TiCDC officially supports open-protocol, canal-json, avro, debezim and simple 5 encoding protocols, only the open-protocol set the key part.
We encode the key and value into JSON format, only makes the open-protocol generate only one object to carry all message information.

{
  “key”: xxx,
  “value”: xxxx,
}

There are some drawbacks:

  • When using other protocols except open-protocol, the key part is always null.
  • If any part is quit large, encoding phase may waste some CPU resource.
  • If any part is quit large, the size of the result JSON bytes is larger than the size sum of the original key and value.

Describe the feature you'd like

We propose introducing one new changefeed level configuration, named claim-check-raw-value, to control whether encode key and value into JSON format or not.

[sink.kafka-config.large-message-handle]
large-message-handle-option = "claim-check"
claim-check-storage-uri = "xxx"
claim-check-raw-value = true # default to false   

claim-check-raw-value is default to false, to make the default behavior compatible to previous version. After setting it to true, only deliver the value part to the external storage, the value is the result of protocol encoding:

  • If using avro and simple protocol with avro encoding, it's avro format bytes.
  • If using canal-json、debezium and simple protocol with json encoding, it's json format bytes.
xxxxxx # this is the value bytes, no other decorations

Describe alternatives you've considered

No response

Teachability, Documentation, Adoption, Migration Strategy

Add document to introduce this new configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ticdc Issues or PRs related to TiCDC. kafka type/feature Issues about a new feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant