cockroachdb / cockroachdb/cockroach

kv: batched intent resolution for same transaction performs redundant AbortSpan reads

Open
#108,614 0 comments 0 reactions 0 assignees View on GitHub
A-kv-transactions C-performance T-kv
Dominant language
Go
Stars
32.5k
Forks
4.1k
PR merge metrics
PR metrics pending

Description

When a large transaction is abandoned without cleanup up its intents, intent resolution is performed in batches of point `ResolveIntent` requests. During evaluation, each of these `ResolveIntent` requests calls into `UpdateAbortSpan` to update the abort span. While the majority of these calls to `UpdateAbortSpan` do not end up creating a new abort span entry, they do still pay the cost to read. This cost is non-negligible, as seen in the following CPU profile, where `UpdateAbortSpan` accounts for about 33% of time:

![Screenshot 2023-08-10 at 9 18 43 AM](https://github.com/cockroachdb/cockroach/assets/5438456/c8f017e9-853a-40c7-b6c2-822da4e82d40)

Eliminating the redundancy here could be a worthwhile performance optimization to speed up intent cleanup for abandoned transactions.

Jira issue: CRDB-30549

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.