sql: fix crdb_internal.{leases,node_runtime_info} when accessed by a tenant#55738
Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom Oct 20, 2020
asubiotto:fix55701
Merged
sql: fix crdb_internal.{leases,node_runtime_info} when accessed by a tenant#55738craig[bot] merged 1 commit intocockroachdb:masterfrom asubiotto:fix55701
craig[bot] merged 1 commit intocockroachdb:masterfrom
asubiotto:fix55701
Conversation
…tenant
Previously, accessing either of theses tables would lead to an internal error.
This was caused by defaulting to using a null node ID if the node ID was
unavailable, causing a null violation during validation.
The rest of internal tables simply use the zero node ID, so this commit fixes
crdb_internal.{leases,node_runtime_info} to use this behavior as well.
Release note: None
Member
tbg
approved these changes
Oct 20, 2020
Member
tbg
left a comment
There was a problem hiding this comment.
Thank you and sorry, I think I screwed this one up.
Contributor
Author
|
No worries! TFTR bors r=tbg |
Contributor
|
Build succeeded: |
| # LogicTest: 3node-tenant | ||
|
|
||
| query II | ||
| SELECT count(distinct(node_id)), count(*) FROM crdb_internal.node_runtime_info |
Contributor
There was a problem hiding this comment.
It'd be good to have at least one test case for all the internal tables and functions, to ensure they don't regress. I'd copy the entire crdb_internal suite, and then modify it for tenants, so that our testing is at least as good as that.
Contributor
Author
There was a problem hiding this comment.
Good point. Doing this in #55860 and will backport both these commits to 20.2.1
Contributor
|
Thanks for fixing this so quickly. Can you be sure to backport it to 20.2.1? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Previously, accessing either of theses tables would lead to an internal error.
This was caused by defaulting to using a null node ID if the node ID was
unavailable, causing a null violation during validation.
The rest of internal tables simply use the zero node ID, so this commit fixes
crdb_internal.{leases,node_runtime_info} to use this behavior as well.
Release note: None
Fixes #55701