-
Notifications
You must be signed in to change notification settings - Fork 188
relay: align with MySQL when using GTID #1390
Conversation
/run-all-tests |
/run-all-tests |
/run-all-tests |
1 similar comment
/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.
will review later
// modify header | ||
headerClone := *header // do a copy | ||
headerClone.Flags = 0 | ||
headerClone.EventSize = 39 |
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.
does MySQL choose not keeping size? I think this may cause positions in query-status
mismatched which may confuse user
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.
It keeps the LogPos but not EventSize.
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.
That meets problem when we calculate startPosition, but we don't calculate it for heartbeat event.
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.
will review later
pkg/streamer/reader.go
Outdated
err2 := r.advanceCurrentGtidSet(fmt.Sprintf("%s:%d", u.String(), ev.GNO)) | ||
if err2 != nil { | ||
return errors.Trace(err2) | ||
r.replaceWithHeartbeat, err = r.advanceCurrentGtidSet(fmt.Sprintf("%s:%d", u.String(), ev.GNO)) |
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.
could we use a local variable instead of a member of BinlogReader
? BTW, I think we could reset replaceWithHeartbeat
before switch
in L446
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.
Change to local variable. We should not reset since if a GTIDEvent is replaced with heartbeat event, that means later event such QueryEvent, RowsEvent,TableMapEvent should also be replaced because they are in the same transaction.
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.
rest LGTM
(I'll commit the changes since author is leaving)
/lgtm |
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
/lgtm |
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
cherry pick to release-2.0 in PR #1403 |
What problem does this PR solve?
close #1383
What is changed and how it works?
Check List
Tests