-
Notifications
You must be signed in to change notification settings - Fork 4.1k
sql, kv: SELECT FOR UPDATE appears to delay the lock cleanup on RootTxn in some cases #94400
Copy link
Copy link
Closed
Labels
C-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.GA-blockerT-kvKV TeamKV Teambranch-release-23.1Used to mark GA and release blockers, technical advisories, and bugs for 23.1Used to mark GA and release blockers, technical advisories, and bugs for 23.1
Description
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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
C-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.GA-blockerT-kvKV TeamKV Teambranch-release-23.1Used to mark GA and release blockers, technical advisories, and bugs for 23.1Used to mark GA and release blockers, technical advisories, and bugs for 23.1