-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
table/tables: remove int handle id from row to fix binlog issue (#30489) #34109
base: master
Are you sure you want to change the base?
Conversation
[REVIEW NOTIFICATION] This pull request has not been approved. To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
Code Coverage Details: https://codecov.io/github/pingcap/tidb/commit/b1c846857c8711e9d17f003a7369704e5c5c9f72 |
The root cause of this kind of bug is the vague coding protocol. The signature of the Later on, we have 'PK as handle', and later the 'comman handle', so the handle may be also included in the table row. Things become complex from this time. So whether the For example, 'insert into t values (...)' would call the I think vague coding protocol is the root cause. |
I mean no extra handle column we added manually. |
@@ -1284,7 +1284,12 @@ func partitionedTableUpdateRecord(gctx context.Context, ctx sessionctx.Context, | |||
// So this special order is chosen: add record first, errors such as | |||
// 'Key Already Exists' will generally happen during step1, errors are | |||
// unlikely to happen in step2. | |||
err = t.GetPartition(from).RemoveRecord(ctx, h, currData) | |||
deleteData := currData | |||
if !t.Meta().IsCommonHandle && !t.Meta().PKIsHandle && len(deleteData) > len(t.Cols()) { |
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.
if !t.Meta().IsCommonHandle && !t.Meta().PKIsHandle && len(deleteData) > len(t.Cols()) {
IMHO it's tricky to remove the handle column in this way...Is there any existing code like this?
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.
I agree that it is tricky and I would not propose it if it would not been done like this here. And now when looking at the code in deleteSingleTableByChunk I think I agree with @tiancaiamao and will try to change the protocol/caller instead.
@mjonss: PR needs rebase. 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/test-infra repository. |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #34109 +/- ##
================================================
- Coverage 63.5589% 63.5242% -0.0348%
================================================
Files 826 827 +1
Lines 269471 269738 +267
================================================
+ Hits 171273 171349 +76
- Misses 84636 84806 +170
- Partials 13562 13583 +21 |
@mjonss: The following tests failed, say
Full PR test history. Your PR dashboard. 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/test-infra repository. I understand the commands that are listed here. |
What problem does this PR solve?
The int handle id is still in the row when writing to binlog, which causes an error. We follow a similar path as for non-partitioned tables and removing the handle id from the row if it exists.
Issue Number: close #30489
Problem Summary:
What is changed and how it works?
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.