Skip to content

sql: savepoints are broken with slow statements on master #94337

@jordanlewis

Description

@jordanlewis

While investigating #93379, @rafiss and I have discovered some very broken behavior with savepoints on master.

The following logic test fails, but it should succeed (seeing nothing in the final output statement):

statement ok
CREATE TABLE a (id INT);
CREATE TABLE b (id INT8)

statement ok
BEGIN

statement ok
SELECT pg_sleep(1.5)

statement ok
SAVEPOINT s

statement ok
SELECT pg_sleep(1.5)

statement ok
INSERT INTO a(id) VALUES (0);
INSERT INTO b(id) VALUES (0)

statement ok
ROLLBACK TO SAVEPOINT s

query I
SELECT * FROM a
----

The pg_sleep statements are important to make this fail, suggesting timing issues.

Jira issue: CRDB-22839

Metadata

Metadata

Assignees

Labels

C-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.T-kvKV Teambranch-release-23.1Used to mark GA and release blockers, technical advisories, and bugs for 23.1release-blockerIndicates a release-blocker. Use with branch-release-2x.x label to denote which branch is blocked.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions