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-21.1: contention: store contention events on non-SQL keys #62041

Merged
merged 1 commit into from
Mar 16, 2021

Conversation

yuzefovich
Copy link
Member

Backport 1/1 commits from #61828.

/cc @cockroachdb/release


Previously, whenever we tried to add a contention event on a non-SQL
key, it would encounter an error during decoding tableID/indexID pair,
and the event was dropped. This commit extends the contention registry
to additionally store information about contention on non-SQL keys. That
information is stored in two levels:

  • on the top level, all SingleNonSQLKeyContention objects are ordered
    by their keys
  • on the bottom level, all SingleTxnContention objects are ordered by the
    number of times that transaction was observed to contend with other
    transactions.

SingleTxnContention protobuf message is moved out of
SingleKeyContention and is reused for non-SQL keys. This commit also
updates the status server API response. I assume that no changes are
needed with regards to backwards compatibility since the original
version was merged just a few weeks ago, and we haven't had a beta
released since then.

Fixes: #60669.

Release note (sql change): CockroachDB now also stores the information
about contention on non-SQL keys.

Previously, whenever we tried to add a contention event on a non-SQL
key, it would encounter an error during decoding tableID/indexID pair,
and the event was dropped. This commit extends the contention registry
to additionally store information about contention on non-SQL keys. That
information is stored in two levels:
- on the top level, all `SingleNonSQLKeyContention` objects are ordered
  by their keys
- on the bottom level, all `SingleTxnContention` objects are ordered by the
  number of times that transaction was observed to contend with other
  transactions.

`SingleTxnContention` protobuf message is moved out of
`SingleKeyContention` and is reused for non-SQL keys. This commit also
updates the status server API response. I assume that no changes are
needed with regards to backwards compatibility since the original
version was merged just a few weeks ago, and we haven't had a beta
released since then.

Release note (sql change): CockroachDB now also stores the information
about contention on non-SQL keys.
@yuzefovich yuzefovich requested a review from asubiotto March 15, 2021 21:48
@yuzefovich yuzefovich requested review from a team as code owners March 15, 2021 21:48
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@yuzefovich yuzefovich merged commit 58061b6 into cockroachdb:release-21.1 Mar 16, 2021
@yuzefovich yuzefovich deleted the backport21.1-61828 branch March 16, 2021 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants