-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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: fix crdb_internal.{leases,node_runtime_info} when accessed by a tenant #55738
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you and sorry, I think I screwed this one up.
No worries! TFTR bors r=tbg |
Build succeeded: |
# LogicTest: 3node-tenant | ||
|
||
query II | ||
SELECT count(distinct(node_id)), count(*) FROM crdb_internal.node_runtime_info |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. Doing this in #55860 and will backport both these commits to 20.2.1
Thanks for fixing this so quickly. Can you be sure to backport it to 20.2.1? |
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