-
Notifications
You must be signed in to change notification settings - Fork 288
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
pkg/gtid: remove gtid.Set interface #5246
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. |
I'll write a better copy-on-write API for GTID set after binlog streamer refactor (binlog streamer is the only writer for location under the syncer, things will be more simple then). |
Signed-off-by: lance6716 <[email protected]>
/run-dm-integration-test |
/run-dm-integration-test |
Signed-off-by: lance6716 <[email protected]>
/run-dm-integration-test |
Codecov Report
Flags with carried forward coverage won't be shown. Click here to find out more. @@ Coverage Diff @@
## master #5246 +/- ##
================================================
- Coverage 56.1240% 55.9300% -0.1940%
================================================
Files 522 520 -2
Lines 65325 67858 +2533
================================================
+ Hits 36663 37953 +1290
- Misses 25094 26184 +1090
- Partials 3568 3721 +153 |
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
dm/pkg/binlog/position.go
Outdated
return cmp <= 0 | ||
} | ||
// not supposed to happen, for safety here. | ||
if location1.gtidSet != nil && location1.gtidSet.String() != "" { | ||
if cmp > 0 { | ||
return false | ||
} | ||
// should not happen | ||
if cmp < 0 { | ||
return true | ||
} | ||
// empty GTIDSet, then compare by position | ||
log.L().Warn("both gtidSets are empty, will compare by position", zap.Stringer("location1", location1), zap.Stringer("location2", location2)) | ||
log.L().Warn("given gtidSets is empty, will compare by position", zap.Stringer("location", location)) |
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.
Nit: use switch here?
dm/syncer/checkpoint.go
Outdated
return "" | ||
} | ||
var buf strings.Builder | ||
buf.WriteString(fmt.Sprintf("location(%s)", b.location)) |
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.
buf.WriteString(fmt.Sprintf("location(%s)", b.location)) | |
fmt.Fprintf(&buf, "location(%s)", b.location) |
dm/syncer/checkpoint.go
Outdated
var buf strings.Builder | ||
buf.WriteString(fmt.Sprintf("location(%s)", b.location)) | ||
if b.ti != nil { | ||
buf.WriteString(fmt.Sprintf(", tableInfo(ID: %d, Name:%s, ColNum: %d, IdxNum: %d, PKIsHandle: %t)", b.ti.ID, b.ti.Name, len(b.ti.Columns), len(b.ti.Indices), b.ti.PKIsHandle)) |
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.
ditto
dm/syncer/checkpoint.go
Outdated
@@ -183,7 +192,7 @@ func (b *binlogPoint) String() string { | |||
b.RLock() | |||
defer b.RUnlock() | |||
|
|||
return fmt.Sprintf("%v(flushed %v)", b.savedPoint, b.flushedPoint) | |||
return fmt.Sprintf("%s(flushed %s)", b.savedPoint.String(), b.flushedPoint.String()) |
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.
ditto
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
/run-dm-integration-test |
/run-verify |
/run-dm-compatibility-tests |
/run-dm-integration-tests |
/run-dm-compatibility-tests |
I think this change will reduce efforts on other PRs which are related to GTID, so I change the base branch to master. cc @Ehco1996 @lichunzhu @GMHDBJD will resolve conflict later. |
/run-dm-integration-test |
/run-dm-integration-test |
/run-verify |
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 ~ nice work
/merge |
This pull request has been accepted and is ready to merge. Commit hash: e680bc8
|
/run-dm-integration-test |
@lance6716: Your PR was out of date, I have automatically updated it for you. At the same time I will also trigger all tests for you: /run-all-tests If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes. 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 ti-community-infra/tichi repository. |
What problem does this PR solve?
Issue Number: close #4287
What is changed and how it works?
compared with mysql.GTIDSet, gtid.Set has two more methods.
Replace
is no longer usedTruncate
is used but does not take effects, see relay: fix GTID recover after relay log recovered dm#335 (comment)Check List
Tests
Code changes
Related changes
Release note