catalog: Add mz_overridden_system_parameters relation#37302
Conversation
SangJunBak
left a comment
There was a problem hiding this comment.
All in all, I really like this change and it'll make it much easier to debug self managed. The policy change of having system variables public to everyone seems okay to me, especially since users can find the default values from the repo and we're not storing secrets inside our system parameters. Code looks good to me too but I'll delegate the policy decision to @aljoscha
mtabebe
left a comment
There was a problem hiding this comment.
Minor comments. Good idea
90b4c3f to
0053672
Compare
0053672 to
d7b896c
Compare
They could also just read from Thanks for the reviews! |
Add `mz_internal.mz_overridden_system_parameters`, a materialized view exposing environment-wide system parameter overrides set via `ALTER SYSTEM`. It mirrors the existing `mz_cluster_system_parameters` and `mz_replica_system_parameters` views, projecting the durable `system_configurations` collection out of `mz_catalog_raw` where the record kind is `ServerConfiguration`. This lets any user observe the effective environment-wide overrides without `SHOW ALL`, which only surfaces a limited set unless the session is the highly privileged `mz_system` user. Like the scoped views, it lists only parameters with an explicit override. Parameters left at their default are absent. Tests: extends the catalog testdrive listing and the autogenerated mz_internal, oid, information_schema_tables, and catalog_server_explain sqllogictest snapshots. Makes catalog_server_explain hermetic with a `reset-server` directive so role OIDs from preceding files no longer leak into its constant-folded plans. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
d7b896c to
af2594f
Compare
@antiguru Ah not exactly. That relation by default only gives access to the system user too. I still think it's okay to surface this to everyone, but just wanted to clarify! Edit: Just tested it out and we actually allow superusers to query it too. I got confused by this comment https://github.com/SangJunBak/materialize//blob/main/src/catalog/src/builtin/mz_internal.rs#L48 |
Adds
mz_internal.mz_overridden_system_parameters, a materialized view exposing environment-wide system parameter overrides set viaALTER SYSTEM.It mirrors the existing
mz_cluster_system_parametersandmz_replica_system_parametersviews, projecting the durablesystem_configurationscollection out ofmz_catalog_rawwhere the record kind isServerConfiguration.Today the only way to observe environment-wide system parameters is
SHOW ALL, which surfaces a limited set unless the session is themz_systemuser.That user is too privileged for merely inspecting effective parameter values.
This view is
PUBLIC_SELECT, so any user can read the overrides.Like the cluster- and replica-scoped views, it lists only parameters with an explicit environment-wide override.
Parameters left at their default are absent.
Surfacing the effective value of every parameter, including unset defaults, would require reading live
SystemVarsrather than the durable overrides, and is left as a follow-up.Tests: extends the catalog testdrive listing and the autogenerated mz_internal, oid, information_schema_tables, and catalog_server_explain sqllogictest snapshots.
The catalog_server_explain snapshot is made hermetic with a
reset-serverdirective so role OIDs from preceding files no longer leak into its constant-folded plans.This release will add the
mz_overridden_system_parameterssystem catalog relation, listing environment-wide system parameter overrides.🤖 Generated with Claude Code