Skip to content

Commit

Permalink
VReplication: disable use of session_track_gtids (#16424)
Browse files Browse the repository at this point in the history
Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
  • Loading branch information
shlomi-noach authored Jul 17, 2024
1 parent c9c0aa5 commit 7c30816
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 16 deletions.
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

0 comments on commit 7c30816

Please sign in to comment.