Skip to content

catalog: Add mz_overridden_system_parameters relation#37302

Merged
antiguru merged 1 commit into
MaterializeInc:mainfrom
antiguru:mz-system-parameters
Jun 25, 2026
Merged

catalog: Add mz_overridden_system_parameters relation#37302
antiguru merged 1 commit into
MaterializeInc:mainfrom
antiguru:mz-system-parameters

Conversation

@antiguru

@antiguru antiguru commented Jun 25, 2026

Copy link
Copy Markdown
Member

Adds 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.

Today the only way to observe environment-wide system parameters is SHOW ALL, which surfaces a limited set unless the session is the mz_system user.
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 SystemVars rather 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-server directive so role OIDs from preceding files no longer leak into its constant-folded plans.

This release will add the mz_overridden_system_parameters system catalog relation, listing environment-wide system parameter overrides.

🤖 Generated with Claude Code

@antiguru antiguru marked this pull request as ready for review June 25, 2026 16:21
@antiguru antiguru requested review from a team as code owners June 25, 2026 16:21
@antiguru antiguru requested a review from mtabebe June 25, 2026 16:21

@SangJunBak SangJunBak left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread doc/user/content/reference/system-catalog/mz_internal.md Outdated

@mtabebe mtabebe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor comments. Good idea

Comment thread src/catalog/src/builtin/mz_internal.rs Outdated
@antiguru antiguru force-pushed the mz-system-parameters branch from 90b4c3f to 0053672 Compare June 25, 2026 19:41
@antiguru antiguru changed the title catalog: Add mz_system_parameters relation catalog: Add mz_overridden_system_parameters relation Jun 25, 2026
@antiguru antiguru force-pushed the mz-system-parameters branch from 0053672 to d7b896c Compare June 25, 2026 19:51
@antiguru antiguru enabled auto-merge (squash) June 25, 2026 19:51
@antiguru

Copy link
Copy Markdown
Member Author

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.

They could also just read from mz_internal.mz_catalog_raw. The information is there already, just so in a more digestible form.

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>
@antiguru antiguru force-pushed the mz-system-parameters branch from d7b896c to af2594f Compare June 25, 2026 20:11
@SangJunBak

SangJunBak commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

They could also just read from mz_internal.mz_catalog_raw. The information is there already, just so in a more digestible form.

@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

@antiguru antiguru merged commit c6a1cb2 into MaterializeInc:main Jun 25, 2026
121 checks passed
@antiguru antiguru deleted the mz-system-parameters branch June 25, 2026 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants