codec: fix the open protocol flag#1228
Conversation
|
/retest |
There was a problem hiding this comment.
Pull Request Overview
This PR fixes issues in the open protocol flag handling for TiCDC by updating underlying flag types and helper functions. Key changes include:
- Changing the column Flag type from uint to uint64 and updating related flag-check calls to use new helper functions (e.g. isBinary, isUnsigned, isPrimary).
- Introducing a column flags caching mechanism in the batch encoder to improve flag calculation efficiency.
- Adjusting encoding and decoding logic to properly pass the computed column flags.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/sink/codec/open/message.go | Updates flag type and flag checks using helper functions |
| pkg/sink/codec/open/encoder_test.go | Adds/updates tests to verify proper event encoding |
| pkg/sink/codec/open/encoder.go | Introduces columnFlagsCache and updates encoding to use cached flags |
| pkg/sink/codec/open/decoder.go | Replaces direct mysql flag checks with helper function calls |
| pkg/sink/codec/open/codec.go | Updates row event encoding to include column flags |
Comments suppressed due to low confidence (1)
pkg/sink/codec/open/decoder.go:254
- Flagging handle key columns with 'binaryFlag' appears incorrect; it should use the proper primary key flag to accurately represent a column's handle key role.
col.Flag |= binaryFlag
| } | ||
| if _, ok := handleKeyColumns[name]; ok { | ||
| col.Flag = mysql.PriKeyFlag | ||
| col.Flag |= binaryFlag |
There was a problem hiding this comment.
it's found a binary flag.
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: wk989898 The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
[LGTM Timeline notifier]Timeline:
|
|
/unhold |
|
/retest |
|
@3AceShowHand: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
What problem does this PR solve?
Issue Number: close #1227
What is changed and how it works?
Check List
Tests
Questions
Will it cause performance regression or break compatibility?
Do you need to update user documentation, design documentation or monitoring documentation?
Release note