Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release-22.1: kv/concurrency: compute contention event duration from (key,txn) wait start time #99940

Merged

Commits on Mar 29, 2023

  1. kv/concurrency: compute contention event duration from (key,txn) wait…

    … start time
    
    Fixes cockroachdb#98104.
    
    This commit resolves the bug identified in cockroachdb#98104 where multiple contention
    events could be emitted with overlapping durations, such that when these
    durations were added together (e.g. by `GetCumulativeContentionTime`), their sum
    was larger than the runtime of the entire query. This was possible because as of
    70ef641, we were failing to reset the waiting start time on each new lock
    holder transaction for the same key.
    
    This commit fixes this by computing the contention event duration using
    `contentionTag.waitStart` instead of `waitingState.lockWaitStart`. It also
    cleans up some of this code and makes it harder to make such a mistake in the
    future.
    
    Release note: None
    nvanbenschoten committed Mar 29, 2023
    Configuration menu
    Copy the full SHA
    38097f9 View commit details
    Browse the repository at this point in the history