-
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
settings: rename and better document the setting classes #111378
Conversation
Looks like the actual labels are |
These labels are internal to the source code and not user-facing, which is why they are not mentioned in the release note. Only the (auto-generated) table with settings will mention the classes, and the doc writer can choose which labels to use to generate the table (using the |
pkg/settings/setting.go
Outdated
// | ||
// - SystemOnly should be used with caution: even internal tenant code is | ||
// disallowed from using these settings at all. | ||
// 3. if a non-ApplicationLevel setting is ever accessed by |
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.
Nit: You might want to word this as "if and only if" to avoid splitting the "if" and "only then" part between so many words. Additionally, you may want to split the last sentence out to its own bullet, as it's a pretty important point that's somewhat buried right now. Finally instead of "non-ApplicationLevel", can we say "System-level"?
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.
You might want to word this as "if and only if" to avoid splitting the "if" and "only then" part between so many words.
Done.
you may want to split the last sentence out to its own bullet
Done.
Finally instead of "non-ApplicationLevel", can we say "System-level"?
I think we should include both. The 3 points so far only mentioned ApplicationLevel, so I believe the text here should refer to it primarily.
a7f368e
to
2180082
Compare
2180082
to
a7c5cf2
Compare
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.
Overall, I think this is moving us in the right direction. Just one small suggestion.
// - OR, different virtual clusters should be able to | ||
// use different values for the setting. | ||
// | ||
// (If this part of the condition does not hold, consider | ||
// SystemOnly or SystemVisible instead.) |
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.
I wonder if we should provide some more guidance here. Namely, most settings should be ApplicationLevel if they aren't in the KV/storage layer.
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.
Done.
// - AND the setting should only be controllable by SREs (not | ||
// end-users) in CockroachCloud Serverless, AND a single value | ||
// must apply to all virtual clusters simultaneously; |
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.
We have some settings like those in the tenantcostclient that sort of violate this as written. In the current documentation, it looks like we should have made those ApplicationLevel and CC should have set an override.
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.
Very astute observation. I am very keen to have that convo with the CC team. But I feel that this convo will only be productive after we settle on the guidance.
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.
I agree. I don't think we should rely on external process to set those overrides though - we could set them ourselves by default (in a permanent upgrade).
c736aef
to
f0de329
Compare
pkg/settings/setting.go
Outdated
// cannot be accessed from application layer code (in particular not | ||
// from SQL layer nor HTTP handlers). | ||
// | ||
// As a rule of thumb, this class should be rarely used. We expect |
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.
Why should it be rarely used? It seems that all the settings related to KV and below (all the way down to Pebble settings) belong here, of which there are many.
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.
ok i'll soften that up.
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.
I like the new naming and guidance, nicely done!
f0de329
to
ca52744
Compare
**TLDR: "TenantReadOnly" -> "SystemVisible"; "TenantWritable" -> "ApplicationLevel".** See the new/extended explanatory comments in `pkg/settings/setting.go` for details. Review guidance: the only manual change is in `pkg/settings/setting.go`. Everything else was automated search-replace. No release note because the classes are not user-visible. Release note: None
ca52744
to
e9a6d3d
Compare
bors r=ajstorm,stevendanna,dt,RaduBerinde |
Build succeeded: |
Thanks for the cleanup and improvements here!
Consider pointing out that virtual clusters never see the system setting, these are entirely independent per tenant.
Consider pointing out that it is still possible for the operator to set per-tenant values for a setting. |
thanks for the extra feedback, let's discuss first. |
111338: storage: strengthen time-bound iteration guarantees r=sumeerbhola a=jbowens Previously, the minimum and maximum timestamps used to configure a "time-bound" iterator were only hints. The iterator would surface keys outside those bounds frequently if the keys were contained within a sstable block that also contained keys within bounds. This commit adapts the iterator construction to use Pebble's IterOptions.SkipPoint option to filter out-of-range keys without yielding them to the caller. This adds a small additional overhead to processing KVs that are ultimately yielded to the user of a MVCCIncrementalIterator, but removes a large overhead to proessing KVs that are ultimately skipped. In the current MVCCIncrementalIterator implementation, keys that are outside the time range still reposition the iterator without time bounds. This repositioning no longer happens, and removing this overhead more than reclaims the RefreshRange benchmark's regression from value blocks packing keys more densely. This also serves as a step towards #66869. ``` goos: linux goarch: amd64 cpu: Intel(R) Xeon(R) CPU @ 2.80GHz │ old.txt │ new.txt │ │ sec/op │ sec/op vs base │ RefreshRange/linear-keys/refresh_window=[0.00,0.00]-24 150.73µ ± 1% 55.75µ ± 1% -63.01% (p=0.000 n=10) RefreshRange/linear-keys/refresh_window=[0.00,50.00]-24 16.52µ ± 1% 16.19µ ± 2% -2.00% (p=0.005 n=10) RefreshRange/linear-keys/refresh_window=[0.00,75.00]-24 13.94µ ± 1% 13.59µ ± 1% -2.55% (p=0.000 n=10) RefreshRange/linear-keys/refresh_window=[0.00,95.00]-24 13.97µ ± 1% 13.56µ ± 3% -2.99% (p=0.002 n=10) RefreshRange/linear-keys/refresh_window=[0.00,99.00]-24 13.96µ ± 1% 13.45µ ± 3% -3.69% (p=0.000 n=10) RefreshRange/linear-keys/refresh_window=[50.00,50.00]-24 149.95µ ± 1% 55.67µ ± 1% -62.88% (p=0.000 n=10) RefreshRange/linear-keys/refresh_window=[50.00,75.00]-24 22.05µ ± 1% 21.70µ ± 0% -1.57% (p=0.000 n=10) RefreshRange/linear-keys/refresh_window=[50.00,95.00]-24 22.08µ ± 1% 21.61µ ± 0% -2.14% (p=0.000 n=10) RefreshRange/linear-keys/refresh_window=[50.00,99.00]-24 21.91µ ± 1% 21.69µ ± 1% -0.99% (p=0.000 n=10) RefreshRange/linear-keys/refresh_window=[75.00,75.00]-24 139.27µ ± 1% 55.82µ ± 1% -59.92% (p=0.000 n=10) RefreshRange/linear-keys/refresh_window=[75.00,95.00]-24 23.76µ ± 1% 23.36µ ± 0% -1.66% (p=0.000 n=10) RefreshRange/linear-keys/refresh_window=[75.00,99.00]-24 23.85µ ± 1% 23.25µ ± 1% -2.48% (p=0.000 n=10) RefreshRange/linear-keys/refresh_window=[95.00,95.00]-24 138.94µ ± 1% 55.52µ ± 0% -60.04% (p=0.000 n=10) RefreshRange/linear-keys/refresh_window=[95.00,99.00]-24 26.68µ ± 1% 26.30µ ± 1% -1.42% (p=0.005 n=10) RefreshRange/linear-keys/refresh_window=[99.00,99.00]-24 141.39µ ± 1% 55.02µ ± 1% -61.09% (p=0.000 n=10) RefreshRange/random-keys/refresh_window=[0.00,0.00]-24 322.35µ ± 0% 51.21µ ± 0% -84.11% (p=0.000 n=10) RefreshRange/random-keys/refresh_window=[0.00,50.00]-24 16.35µ ± 1% 16.63µ ± 2% ~ (p=0.105 n=10) RefreshRange/random-keys/refresh_window=[0.00,75.00]-24 17.42µ ± 1% 17.29µ ± 3% ~ (p=0.796 n=10) RefreshRange/random-keys/refresh_window=[0.00,95.00]-24 13.40µ ± 1% 13.45µ ± 1% ~ (p=0.529 n=10) RefreshRange/random-keys/refresh_window=[0.00,99.00]-24 13.59µ ± 2% 13.41µ ± 0% ~ (p=0.239 n=10) RefreshRange/random-keys/refresh_window=[50.00,50.00]-24 707.5m ± 1% 111.7m ± 1% -84.21% (p=0.000 n=10) RefreshRange/random-keys/refresh_window=[50.00,75.00]-24 21.94µ ± 1% 17.86µ ± 0% -18.59% (p=0.000 n=10) RefreshRange/random-keys/refresh_window=[50.00,95.00]-24 13.95µ ± 1% 13.54µ ± 1% -2.94% (p=0.000 n=10) RefreshRange/random-keys/refresh_window=[50.00,99.00]-24 13.96µ ± 0% 13.53µ ± 1% -3.06% (p=0.000 n=10) RefreshRange/random-keys/refresh_window=[75.00,75.00]-24 395.22m ± 0% 33.81m ± 1% -91.45% (p=0.000 n=10) RefreshRange/random-keys/refresh_window=[75.00,95.00]-24 19.42µ ± 1% 19.40µ ± 1% ~ (p=0.912 n=10) RefreshRange/random-keys/refresh_window=[75.00,99.00]-24 19.37µ ± 1% 19.42µ ± 1% ~ (p=0.247 n=10) RefreshRange/random-keys/refresh_window=[95.00,95.00]-24 546.66m ± 3% 48.48m ± 3% -91.13% (p=0.000 n=10) RefreshRange/random-keys/refresh_window=[95.00,99.00]-24 21.69µ ± 1% 19.68µ ± 1% -9.24% (p=0.000 n=10) RefreshRange/random-keys/refresh_window=[99.00,99.00]-24 546.27m ± 0% 48.73m ± 3% -91.08% (p=0.000 n=10) RefreshRange/mixed-case/refresh_window=[0.00,0.00]-24 410.1µ ± 0% 221.1µ ± 1% -46.09% (p=0.000 n=10) RefreshRange/mixed-case/refresh_window=[0.00,50.00]-24 14.84µ ± 1% 14.84µ ± 1% ~ (p=0.739 n=10) RefreshRange/mixed-case/refresh_window=[0.00,75.00]-24 14.84µ ± 1% 14.83µ ± 1% ~ (p=0.615 n=10) RefreshRange/mixed-case/refresh_window=[0.00,95.00]-24 17.39µ ± 2% 17.51µ ± 2% +0.68% (p=0.029 n=10) RefreshRange/mixed-case/refresh_window=[0.00,99.00]-24 16.41µ ± 1% 16.38µ ± 1% ~ (p=0.971 n=10) RefreshRange/mixed-case/refresh_window=[50.00,50.00]-24 660.9m ± 0% 140.6m ± 3% -78.73% (p=0.000 n=10) RefreshRange/mixed-case/refresh_window=[50.00,75.00]-24 20.43µ ± 1% 15.46µ ± 1% -24.31% (p=0.000 n=10) RefreshRange/mixed-case/refresh_window=[50.00,95.00]-24 18.03µ ± 1% 17.66µ ± 1% -2.01% (p=0.000 n=10) RefreshRange/mixed-case/refresh_window=[50.00,99.00]-24 16.86µ ± 1% 16.70µ ± 1% -0.93% (p=0.011 n=10) RefreshRange/mixed-case/refresh_window=[75.00,75.00]-24 659.5m ± 1% 137.1m ± 3% -79.21% (p=0.000 n=10) RefreshRange/mixed-case/refresh_window=[75.00,95.00]-24 17.96µ ± 1% 17.65µ ± 1% -1.77% (p=0.000 n=10) RefreshRange/mixed-case/refresh_window=[75.00,99.00]-24 16.86µ ± 1% 16.66µ ± 1% -1.23% (p=0.008 n=10) RefreshRange/mixed-case/refresh_window=[95.00,95.00]-24 900.95µ ± 0% 32.18µ ± 0% -96.43% (p=0.000 n=10) RefreshRange/mixed-case/refresh_window=[95.00,99.00]-24 14.35µ ± 1% 14.50µ ± 2% +1.03% (p=0.002 n=10) RefreshRange/mixed-case/refresh_window=[99.00,99.00]-24 227.235m ± 1% 3.361m ± 1% -98.52% (p=0.000 n=10) geomean 136.9µ 73.57µ -46.24% goos: linux goarch: amd64 cpu: Intel(R) Xeon(R) CPU @ 2.80GHz │ old2.txt │ new2.txt │ │ sec/op │ sec/op vs base │ MVCCIncrementalIterator/ts=5-24 24.93m ± 3% 24.53m ± 2% -1.61% (p=0.004 n=10) MVCCIncrementalIterator/ts=480-24 560.4µ ± 1% 453.8µ ± 0% -19.02% (p=0.000 n=10) MVCCIncrementalIteratorForOldData/valueSize=100-24 1.444m ± 0% 1.434m ± 0% -0.72% (p=0.000 n=10) MVCCIncrementalIteratorForOldData/valueSize=500-24 1.994m ± 0% 1.974m ± 1% -1.02% (p=0.000 n=10) MVCCIncrementalIteratorForOldData/valueSize=1000-24 2.672m ± 1% 2.649m ± 1% ~ (p=0.063 n=10) MVCCIncrementalIteratorForOldData/valueSize=2000-24 4.059m ± 1% 4.009m ± 1% -1.23% (p=0.011 n=10) geomean 2.754m 2.635m -4.33% ``` Epic: none Informs #66869 Close #98881 Release note: none 111566: cli/sql: better report the virtual cluster name in the prompt r=stevendanna a=knz First commit from #111565. Fixes #111491. Epic: CRDB-26691 Prior to this patch, the SQL shell was reporting the name of the virtual cluster using the `cluster:` option in the connection URL. This was brittle, as it didn't handle the case where the SQL connection was routed to a virtual cluster implicitly via the cluster setting `server.controller.default_target_cluster`. This commit makes the display more robust by having the server report the virtual cluster name via the `node_build_info` virtual table, alongside the cluster ID and organization which were already communicated in this way. (No release note because this is new functionality in 23.2) 111579: settings: tweak the comment guidance r=erikgrinaker a=knz Epic: CRDB-6671 As suggested by `@erikgrinaker` [here](#111378 (comment)) and discussed [here](https://cockroachlabs.slack.com/archives/C05N2J8ACQH/p1696255584272959). Release note: None Co-authored-by: Jackson Owens <[email protected]> Co-authored-by: Raphael 'kena' Poss <[email protected]>
All commits except the last are from #110758.
Epic: CRDB-6671
Informs #58445.
TLDR: "TenantReadOnly" -> "SystemVisible"; "TenantWritable" -> "ApplicationLevel".
Review guidance: the only manual change is in
pkg/settings/setting.go
. Everything else was automatedsearch-replace.
See the new/extended explanatory comments in
pkg/settings/setting.go
for details.Release note: None