Skip to content

sql: kv txn held open while sql txn waits for ROLLBACK #60915

@tbg

Description

@tbg

Is your feature request related to a problem? Please describe.
While a SQL transaction is in aborted state (i.e. refusing commands, but waiting for explicit ROLLBACK), the corresponding KV transaction is still alive and may hold intents open.

Describe the solution you'd like
Ideally the KV txn would be torn down the moment it is no longer used.

Describe alternatives you've considered
Don't do anything

Additional context
Repro:

-- session 1
create table foo(v int)
begin;
insert into foo values(1)
asdasfasfasfasf
select 1 -- current txn is aborted, commands ignored until end of txn block

-- session 2
begin;
select * from foo -- blocks forever

Jira issue: CRDB-3103

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-sql-executionRelating to SQL execution.C-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)T-sql-queriesSQL Queries Team

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions