Skip to content

Bug Report: SET TRANSACTION ... is turned into SET SESSION TRANSACTION ... #19361

@arthurschreiber

Description

@arthurschreiber

Overview of the Issue

Vitess currently does not support SET TRANSACTION ... commands / changes to the respective @@ variables, and instead turns them into session level changes instead.

I think this is pretty dangerous to do, because read-only and isolation level changes that should've been active for only the next transaction, will suddenly be active for the rest of the session lifetime. This can lead to surprising behavior, like suddenly reading dirty data, unexpected row locking / gap locking, and other weirdness.

(Vitess is already emitting a warning if this happens, but I don't think that's enough.)

Vitess should correctly apply these session level settings only to the next transaction that's started, and then revert back to the current session settings.

Reproduction Steps

SELECT @@session.transaction_isolation; # -- 'REPEATABLE-READ'
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
SELECT @@session.transaction_isolation; # -- 'READ_UNCOMMITTED'

Binary Version

N/A

Operating System and Environment details

N/A

Log Fragments

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs TriageThis issue needs to be correctly labelled and triagedType: Bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions