From bada0b9a793a2725994d137dfeb0697719749d8a Mon Sep 17 00:00:00 2001 From: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com> Date: Wed, 17 Jul 2024 20:57:16 +0300 Subject: [PATCH] VReplication: disable use of `session_track_gtids` (#16424) Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com> Signed-off-by: Florent Poinsard --- go/vt/vttablet/tabletserver/vstreamer/snapshot_conn.go | 9 +-------- go/vt/vttablet/tabletserver/vstreamer/tablestreamer.go | 9 +-------- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/go/vt/vttablet/tabletserver/vstreamer/snapshot_conn.go b/go/vt/vttablet/tabletserver/vstreamer/snapshot_conn.go index bf49ca46618..f3eda83bd45 100644 --- a/go/vt/vttablet/tabletserver/vstreamer/snapshot_conn.go +++ b/go/vt/vttablet/tabletserver/vstreamer/snapshot_conn.go @@ -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 } diff --git a/go/vt/vttablet/tabletserver/vstreamer/tablestreamer.go b/go/vt/vttablet/tabletserver/vstreamer/tablestreamer.go index 80f850dae2e..d3bbd136f12 100644 --- a/go/vt/vttablet/tabletserver/vstreamer/tablestreamer.go +++ b/go/vt/vttablet/tabletserver/vstreamer/tablestreamer.go @@ -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 }