Skip to content

sql, kv: SELECT FOR UPDATE appears to delay the lock cleanup on RootTxn in some cases #94400

@yuzefovich

Description

@yuzefovich

This issue seems similar to #94290 but is applicable even when we don't use the leaf txn in the local only flow (as of #94399). Consider the following setup:

CREATE TABLE data (a INT PRIMARY KEY, b INT);
INSERT INTO data SELECT i, i FROM generate_series(0, 9) AS g(i);
ALTER TABLE data SPLIT AT SELECT i FROM generate_series(1, 9) AS g(i);
SELECT * FROM data FOR UPDATE;
SELECT * FROM data FOR UPDATE;

The second SELECT FOR UPDATE takes much longer (about 500ms vs 3ms for the first run). (Note that I think that the delay is about 50ms x number of ranges involved - 1.)

Jira issue: CRDB-22874

Metadata

Metadata

Assignees

Labels

C-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.GA-blockerT-kvKV Teambranch-release-23.1Used to mark GA and release blockers, technical advisories, and bugs for 23.1

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions