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

sink/codec(cdc): add message size check and support schema default #5451

Merged
merged 9 commits into from
May 18, 2022

Conversation

zhangyangyu
Copy link
Member

@zhangyangyu zhangyangyu commented May 17, 2022

What problem does this PR solve?

Issue Number: ref #5338

What's changed and why?

  1. there is a max-message-bytes limitation when using kafka sink, avro needs to respect it.
  2. Avro protocol supports a default property for record, add support in TiCDC. For TiCDC, this doesn't matter for DML changes since TiCDC will getDefaultValueOrZeroValue for DML change, so we always have a value. But it's important for DDL(schema change). Optional and non-optional columns has different results when register schema into Confluent Schema Registry, https://docs.confluent.io/platform/current/schema-registry/avro.html#summary. Losing the default definition might fail the compatibility check.
  3. goavro doesn't support set default value for logical type. So there is a known limitation that DECIMAL type will lose the default definition.

Release note

None

@ti-chi-bot
Copy link
Member

ti-chi-bot commented May 17, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • 3AceShowHand
  • maxshuang

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added release-note-none Denotes a PR that doesn't merit a release note. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels May 17, 2022
@ti-chi-bot ti-chi-bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels May 17, 2022
@zhangyangyu
Copy link
Member Author

/run-all-tests

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label May 17, 2022
@zhangyangyu
Copy link
Member Author

/run-all-tests

@zhangyangyu
Copy link
Member Author

/run-all-tests

@maxshuang
Copy link
Contributor

LGTM.
Do you have some e2e tests for the avro default value?

@zhangyangyu
Copy link
Member Author

zhangyangyu commented May 17, 2022

LGTM. Do you have some e2e tests for the avro default value?

Avro doesn't fit into the current IT framework now, which definitely should be improved in future. But I have done some manual e2e checks.

@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels May 18, 2022
cdc/sink/codec/avro.go Outdated Show resolved Hide resolved
cdc/sink/codec/avro.go Outdated Show resolved Hide resolved
@Rustin170506
Copy link
Member

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: 7a80b61

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label May 18, 2022
@ti-chi-bot ti-chi-bot merged commit 02b0dfb into pingcap:master May 18, 2022
@zhangyangyu zhangyangyu mentioned this pull request May 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note-none Denotes a PR that doesn't merit a release note. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants