setting: prevent use of SystemOnly settings from tenant code#74253
Merged
craig[bot] merged 2 commits intocockroachdb:masterfrom Jan 10, 2022
Merged
setting: prevent use of SystemOnly settings from tenant code#74253craig[bot] merged 2 commits intocockroachdb:masterfrom
craig[bot] merged 2 commits intocockroachdb:masterfrom
Conversation
Member
Member
Author
|
Friendly ping. |
ajwerner
approved these changes
Jan 10, 2022
Contributor
ajwerner
left a comment
There was a problem hiding this comment.
Reviewed 9 of 9 files at r1, 21 of 21 files at r2, all commit messages.
Reviewable status:complete! 1 of 0 LGTMs obtained (waiting on @dt)
The internal setting code passes around slot indexes as bare integers, and there are confusingly two variants: one is 1-indexed, another is 0-indexed. This change makes all slot indexes 0-indexed and adds a `slotIdx` type. Note: the 1-indexed choice was perhaps useful at the time to help find code paths where the slot index is not initialized, but now the slot index is set along with other mandatory fields by `init()`. Release note: None
This change implements the `system-only` semantics in the RFC (cockroachdb#73349). All SystemOnly setting values are now invisible from tenant code. If tenant code attempts to get or set a SystemOnly setting by handle, it results in panics in test builds; in non-test builds, these settings always report the default value. Release note (sql change): System-only cluster settings are no longer visible for non-system tenants.
c7c9322 to
b08695e
Compare
Member
Author
|
bors r+ |
Contributor
|
Build succeeded: |
16 tasks
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.
setting: clean up slot indexes
The internal setting code passes around slot indexes as bare integers,
and there are confusingly two variants: one is 1-indexed, another is
0-indexed.
This change makes all slot indexes 0-indexed and adds a
slotIdxtype.
Note: the 1-indexed choice was perhaps useful at the time to help find
code paths where the slot index is not initialized, but now the slot
index is set along with other mandatory fields by
init().Release note: None
setting: prevent use of SystemOnly settings from tenant code
This change implements the
system-onlysemantics in the RFC(#73349).
All SystemOnly setting values are now invisible from tenant code. If
tenant code attempts to get or set a SystemOnly setting by handle, it
results in panics in test builds; in non-test builds, these settings
always report the default value.
Release note (sql change): System-only cluster settings are no longer
visible for non-system tenants.