-
Notifications
You must be signed in to change notification settings - Fork 284
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
mounter(ticdc): fix decoding when upstream doesn't enable new collation #11370
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files
Flags with carried forward coverage won't be shown. Click here to find out more. @@ Coverage Diff @@
## master #11370 +/- ##
================================================
+ Coverage 57.5899% 57.6033% +0.0134%
================================================
Files 849 849
Lines 126286 126286
================================================
+ Hits 72728 72745 +17
+ Misses 48144 48128 -16
+ Partials 5414 5413 -1 |
/retest |
cmd/cdc/main.go
Outdated
"github.com/pingcap/tiflow/pkg/cmd" | ||
) | ||
|
||
func main() { | ||
// NOTE: the line is removed from TiDB repo in https://github.com/pingcap/tidb/pull/52191#issuecomment-2024836481. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add more comment to explain why we need to call this function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added.
/test verify |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: asddongmen, CharlesCheung96 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
[LGTM Timeline notifier]Timeline:
|
In response to a cherrypick label: new pull request created to branch |
In response to a cherrypick label: new pull request created to branch |
What problem does this PR solve?
Issue Number: close #11371
What is changed and how it works?
Explicitly call
collate.SetNewCollationEnabledForTest(false)
before run cdc.Previously, this function was called in a tidb package. But it was removed as described in pingcap/tidb#52191 (comment).
If the upstream doesn't enable new collation, the primary key is not encoded in the value part when the table is a cluster index table. And we rely on the following line to decode the primary key.
tiflow/cdc/entry/mounter.go
Line 301 in 2db0922
But this line only decode the primary key when the global variable
newCollationEnabled
in tidb package is false. (It meanscollate.SetNewCollationEnabledForTest(false)
must be called.)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