Skip to content
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

VReplication: disable use of session_track_gtids #16424

Merged
merged 1 commit into from
Jul 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions go/vt/vttablet/tabletserver/vstreamer/snapshot_conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,7 @@ func (conn *snapshotConn) streamWithSnapshot(ctx context.Context, table, query s
query, err)
}

_, err = conn.ExecuteFetch("set session session_track_gtids = START_GTID", 1, false)
if err != nil {
// session_track_gtids = START_GTID unsupported or cannot execute. Resort to LOCK-based snapshot
gtid, err = conn.startSnapshot(ctx, table)
} else {
// session_track_gtids = START_GTID supported. Get a transaction with consistent GTID without LOCKing tables.
gtid, err = conn.startSnapshotWithConsistentGTID(ctx)
}
gtid, err = conn.startSnapshot(ctx, table)
if err != nil {
return "", rotatedLog, err
}
Expand Down
9 changes: 1 addition & 8 deletions go/vt/vttablet/tabletserver/vstreamer/tablestreamer.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,7 @@ func (ts *tableStreamer) Stream() error {
defer conn.Close()
ts.snapshotConn = conn

_, err = conn.ExecuteFetch("set session session_track_gtids = START_GTID", 1, false)
if err != nil {
// session_track_gtids = START_GTID unsupported or cannot execute. Resort to LOCK-based snapshot
ts.gtid, err = conn.startSnapshotAllTables(ts.ctx)
} else {
// session_track_gtids = START_GTID supported. Get a transaction with consistent GTID without LOCKing tables.
ts.gtid, err = conn.startSnapshotWithConsistentGTID(ts.ctx)
}
ts.gtid, err = conn.startSnapshotAllTables(ts.ctx)
if err != nil {
return err
}
Expand Down
Loading