-
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
cluster settings: add setting class to naming #108508
Comments
I am very interested in an infrastructure to rename (or provide aliases) to cluster settings. The place I'm coming from is that many cluster settings today have non-descriptive or poorly-thought names, that are hard to remember or properly document. From a UX design perspective it's important to keep the option to change the name of things on screen over time, in a backward-compatible fashion. |
108902: settings,*: update the settings.Setting API r=yuzefovich a=knz Fixes #108903. Informs: #108508 Epic: CRDB-27642 TLDR: this commit introduces an API distinction between: - the *name* of a cluster setting used for user-facing UX, including the SQL syntax and error messages. - the *key* of a cluster setting used to store its value in `system.settings` and organize various data structures. (In this commit, the name and key remain equivalent to each other; only the interfaces change.) This change achieves the following: - it introduces specific Go types for both key and name. The benefit here is to avoid the go `string` type; and force users of the API to consider what data is used through the settings API. As a side benefit, it ensures that every setting key or name included in logs and error messages is not redacted away. - it paves the way for a later change where the name is allowed to diverge from the key. This will allow us to enhance UX without breaking compatibility. - as a side-benefit, it also marks the "setting origin" attribute as non-redactable. Salient API change, prior to this change: ```go type Setting interface { // Key returns the name of the specific cluster setting. Key() string } ``` After this change: ```go type Setting interface { // InternalKey returns the internal key used to store the setting. // To display the name of the setting (eg. in errors etc) or the // SET/SHOW CLUSTER SETTING statements, use the Name() method instead. // // The internal key is suitable for use with: // - direct accesses to system.settings. // - rangefeed logic associated with system.settings. // - (in unit tests only) interchangeably with the name for SET CLUSTER SETTING InternalKey() InternalKey // Name is the user-visible (display) name of the setting. // This is suitable for: // - SHOW/SET CLUSTER SETTING. // - inclusion in error messages. Name() SettingName } ``` Release note: None Co-authored-by: Raphael 'kena' Poss <[email protected]>
We have addressed this issue in the following ways:
The one thing we have decided NOT to do was to include the class as part of the setting name. It's unclear what actual user problem this would solve, AND it would introduce a new problem: it would require us to teach the user what this means and i would make it hard(er) to change the class in the future. |
Problem:
Cluster settings have 3 options, and there is no way for users and/or engineers to know which setting is for which tenant. This causes confusion and requires either trying it on each of the different tenants or looking up the code to see what the settings option is specified in the code.
Solution:
Add the cluster setting type to the cluster naming. Existing cluster settings can not be renamed because it would be a breaking change. The way to workaround this
Jira issue: CRDB-30501
Epic: CRDB-6671
The text was updated successfully, but these errors were encountered: