Skip to content

codec: fix the open protocol flag#1228

Merged
ti-chi-bot[bot] merged 4 commits intopingcap:masterfrom
3AceShowHand:fix-open-protocol-flag
Apr 16, 2025
Merged

codec: fix the open protocol flag#1228
ti-chi-bot[bot] merged 4 commits intopingcap:masterfrom
3AceShowHand:fix-open-protocol-flag

Conversation

@3AceShowHand
Copy link
Collaborator

@3AceShowHand 3AceShowHand commented Apr 15, 2025

What problem does this PR solve?

Issue Number: close #1227

What is changed and how it works?

  • 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.

Check List

Tests

  • Unit test
  • Integration test

Questions

Will it cause performance regression or break compatibility?
Do you need to update user documentation, design documentation or monitoring documentation?

Release note

`None`

@ti-chi-bot ti-chi-bot bot added do-not-merge/needs-triage-completed release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Apr 15, 2025
@ti-chi-bot ti-chi-bot bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed do-not-merge/needs-triage-completed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Apr 15, 2025
@ti-chi-bot ti-chi-bot bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Apr 15, 2025
@3AceShowHand
Copy link
Collaborator Author

/retest

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@ti-chi-bot ti-chi-bot bot added release-note-none Denotes a PR that doesn't merit a release note. and removed release-note Denotes a PR that will be considered when it comes time to generate release notes. labels Apr 16, 2025
}
if _, ok := handleKeyColumns[name]; ok {
col.Flag = mysql.PriKeyFlag
col.Flag |= binaryFlag
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why use a binary flag?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's found a binary flag.

@ti-chi-bot
Copy link

ti-chi-bot bot commented Apr 16, 2025

[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

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot added the lgtm label Apr 16, 2025
@ti-chi-bot
Copy link

ti-chi-bot bot commented Apr 16, 2025

[LGTM Timeline notifier]

Timeline:

  • 2025-04-16 05:53:45.430815098 +0000 UTC m=+2840519.115051179: ☑️ agreed by wk989898.

@ti-chi-bot ti-chi-bot bot added the approved label Apr 16, 2025
@wk989898 wk989898 added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 16, 2025
@3AceShowHand
Copy link
Collaborator Author

/unhold

@ti-chi-bot ti-chi-bot bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 16, 2025
@3AceShowHand
Copy link
Collaborator Author

/retest

@ti-chi-bot
Copy link

ti-chi-bot bot commented Apr 16, 2025

@3AceShowHand: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-cdc-pulsar-integration-light 64e9580 link false /test pull-cdc-pulsar-integration-light
pull-cdc-kafka-integration-light 64e9580 link false /test pull-cdc-kafka-integration-light

Full PR test history. Your PR dashboard.

Details

Instructions 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.

@ti-chi-bot ti-chi-bot bot merged commit 6e9a122 into pingcap:master Apr 16, 2025
11 of 13 checks passed
wk989898 pushed a commit to wk989898/ticdc that referenced this pull request Apr 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved lgtm 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

kafka integration test since open protocol flag is incorrect

3 participants