-
Notifications
You must be signed in to change notification settings - Fork 287
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
DM(syncer): fix lost lost dml under special sharding ddls #5006
DM(syncer): fix lost lost dml under special sharding ddls #5006
Conversation
[REVIEW NOTIFICATION] This pull request has been approved by:
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. |
/cc @lance6716 @GMHDBJD |
/run-all-tests |
@@ -239,7 +239,8 @@ func (sg *ShardingGroup) CheckSyncing(source string, location binlog.Location) ( | |||
if activeDDLItem == nil { | |||
return true | |||
} | |||
return binlog.CompareLocation(activeDDLItem.FirstLocation, location, sg.enableGTID) > 0 | |||
// ddl position caculate use last_position's gtid, when last is a dml, it will be equal, but the dml should be synced. | |||
return binlog.CompareLocation(activeDDLItem.FirstLocation, location, sg.enableGTID) >= 0 |
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 don't think this is a solution. The issue is because last_position is wrong after pingcap/dm#1926, the correct behavior is
DML
# activeDDLItem.FirstLocation <-- (endlocation of DML, start location of DDL, lastLocation)
DDL
after pingcap/dm#1926
DML
DDL
# activeDDLItem.FirstLocation(gtid) <-- (endlocation of DDL, lastLocation)
so now binlog.CompareLocation(activeDDLItem.FirstLocation, location, sg.enableGTID) greater than 0
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.
But I forgot why we update last location when receive begin, cc @lance6716
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.
maybe to some problems of exit safe point. I'll take a look later
…x-lost-data-by-crossed-ddl
/run-all-tests |
/run-all-tests |
/run-all-tests |
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.
LGTM
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 76f3ef9
|
Signed-off-by: ti-chi-bot <[email protected]>
In response to a cherrypick label: new pull request created: #5026. |
Signed-off-by: ti-chi-bot <[email protected]>
In response to a cherrypick label: new pull request created: #5027. |
In response to a cherrypick label: cannot checkout |
In response to a cherrypick label: cannot checkout |
In response to a cherrypick label: cannot checkout |
In response to a cherrypick label: new pull request created: #5028. |
What problem does this PR solve?
Issue Number: close #5002
What is changed and how it works?
Change the check method of whether sync dml to be
active ddl >= dml
.Check List
Tests
Release note