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

sql: tolerate non-SQL keys in AddContentionEvent #60669

Closed
tbg opened this issue Feb 17, 2021 · 1 comment · Fixed by #61828
Closed

sql: tolerate non-SQL keys in AddContentionEvent #60669

tbg opened this issue Feb 17, 2021 · 1 comment · Fixed by #61828
Assignees
Labels
A-sql-observability Related to observability of the SQL layer C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.

Comments

@tbg
Copy link
Member

tbg commented Feb 17, 2021

Describe the problem

contentionRegistry.AddContentionEvent currently assumes that all keys passed to it are SQL keys. This is not true, as evidenced by this test failure in acceptance/multitenant:

| ERROR: ensuring SQL migrations: failed to run migration "alter scheduled jobs": alter-scheduled-jobs: polling for queued jobs to complete: poll-show-jobs: unable to add contention event to registry: invalid uvarint length of 9

To Reproduce

Run acceptance/multitenant with a version of (*DistSQLReceiver).Push that does not throw away errors from AddContentionEvent.

Expected behavior
I would expect the contention registry to handle such keys gracefully. It could either ignore them, but it's likely worth looking into whethercontention on non-SQL keys should be tracked (since the error above results from a SQL operation).

Environment:

@tbg tbg added A-sql-observability Related to observability of the SQL layer C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. labels Feb 17, 2021
tbg added a commit to tbg/cockroach that referenced this issue Feb 17, 2021
@asubiotto
Copy link
Contributor

We should also panic with any AddContentionEvent errrors in test builds. Hoping that @yuzefovich can take a look at this as part of his other contention work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-sql-observability Related to observability of the SQL layer C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants