-
Notifications
You must be signed in to change notification settings - Fork 188
gtid, relay: use gtid_purged
to handle gap in Previous_gtids event
#1430
Conversation
gtid_purged
to handle gap in Previous_gtids eventgtid_purged
to handle gap in Previous_gtids event
gtid_purged
to handle gap in Previous_gtids eventgtid_purged
to handle gap in Previous_gtids event
// because it doesn't cover all gtid_purged. The error of using it will be | ||
// ERROR 1236 (HY000): The slave is connecting using CHANGE MASTER TO MASTER_AUTO_POSITION = 1, but the master has purged binary logs containing GTIDs that the slave requires. | ||
// so we add gtid_purged to it. | ||
func AddGSetWithPurged(ctx context.Context, gset gtid.Set, conn *sql.Conn) (gtid.Set, error) { |
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.
Why do we use sql.Conn
instead of sql.DB
here?
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.
some callers only hold sql.Conn not sql.DB
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.
in line 108 of pkg/v1dbschema/schema.go (below file). I'll close connection in next commit
if err2 != nil { | ||
return err2 | ||
} | ||
latestGTID, err2 = utils.AddGSetWithPurged(ctx, latestGTID, dbConn) |
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 we don't add purged gtid to result.LatestGTIDs
, do we need to add purged gtid to latestGTID
here?
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-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
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
cherry pick to release-2.0 in PR #1441 |
Signed-off-by: ti-srebot <ti-srebot@pingcap.com> Co-authored-by: lance6716 <lance6716@gmail.com>
What problem does this PR solve?
part of #1418 (we need to test master-slave upstream manually later)
What is changed and how it works?
remove ResetStart, instead, query
@@gtid_purged
and combine it to gtid set when neededCheck List
Tests
Code changes
Side effects
Related changes