release-21.1: contention: store contention events on non-SQL keys #62041
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
SingleNonSQLKeyContention
objects are orderedby their keys
SingleTxnContention
objects are ordered by thenumber of times that transaction was observed to contend with other
transactions.
SingleTxnContention
protobuf message is moved out ofSingleKeyContention
and is reused for non-SQL keys. This commit alsoupdates 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.