diff --git a/go/vt/vttablet/tabletserver/vstreamer/snapshot_conn.go b/go/vt/vttablet/tabletserver/vstreamer/snapshot_conn.go index 1510dbb53ef..bf49ca46618 100644 --- a/go/vt/vttablet/tabletserver/vstreamer/snapshot_conn.go +++ b/go/vt/vttablet/tabletserver/vstreamer/snapshot_conn.go @@ -136,7 +136,7 @@ func (conn *snapshotConn) startSnapshot(ctx context.Context, table string) (gtid if _, err := conn.ExecuteFetch("set transaction isolation level repeatable read", 1, false); err != nil { return "", err } - if _, err := conn.ExecuteFetch("start transaction with consistent snapshot", 1, false); err != nil { + if _, err := conn.ExecuteFetch("start transaction with consistent snapshot, read only", 1, false); err != nil { return "", err } if _, err := conn.ExecuteFetch("set @@session.time_zone = '+00:00'", 1, false); err != nil { @@ -152,7 +152,7 @@ func (conn *snapshotConn) startSnapshotWithConsistentGTID(ctx context.Context) ( if _, err := conn.ExecuteFetch("set transaction isolation level repeatable read", 1, false); err != nil { return "", err } - result, err := conn.ExecuteFetch("start transaction with consistent snapshot", 1, false) + result, err := conn.ExecuteFetch("start transaction with consistent snapshot, read only", 1, false) if err != nil { return "", err } @@ -290,7 +290,7 @@ func (conn *snapshotConn) startSnapshotAllTables(ctx context.Context) (gtid stri if _, err := conn.ExecuteFetch("set transaction isolation level repeatable read", 1, false); err != nil { return "", err } - if _, err := conn.ExecuteFetch("start transaction with consistent snapshot", 1, false); err != nil { + if _, err := conn.ExecuteFetch("start transaction with consistent snapshot, read only", 1, false); err != nil { return "", err } if _, err := conn.ExecuteFetch("set @@session.time_zone = '+00:00'", 1, false); err != nil { diff --git a/go/vt/vttablet/tabletserver/vstreamer/snapshot_conn_test.go b/go/vt/vttablet/tabletserver/vstreamer/snapshot_conn_test.go index eca56797db5..cc0899bc14b 100644 --- a/go/vt/vttablet/tabletserver/vstreamer/snapshot_conn_test.go +++ b/go/vt/vttablet/tabletserver/vstreamer/snapshot_conn_test.go @@ -53,7 +53,7 @@ func TestStartSnapshot(t *testing.T) { Rows: [][]sqltypes.Value{ {sqltypes.NewInt32(1), sqltypes.NewVarBinary("aaa")}, }, - StatusFlags: sqltypes.ServerStatusNoIndexUsed | sqltypes.ServerStatusAutocommit | sqltypes.ServerStatusInTrans, + StatusFlags: sqltypes.ServerStatusInTransReadonly | sqltypes.ServerStatusNoIndexUsed | sqltypes.ServerStatusAutocommit | sqltypes.ServerStatusInTrans, } qr, err := conn.ExecuteFetch("select * from t1", 10, false) require.NoError(t, err)