Skip to content

[catalog] convert mz_default_privileges/mz_system_privileges to BuiltinMaterializedView#37050

Open
mtabebe wants to merge 1 commit into
MaterializeInc:mainfrom
mtabebe:ma/convert-builtins/mz-privileges
Open

[catalog] convert mz_default_privileges/mz_system_privileges to BuiltinMaterializedView#37050
mtabebe wants to merge 1 commit into
MaterializeInc:mainfrom
mtabebe:ma/convert-builtins/mz-privileges

Conversation

@mtabebe

@mtabebe mtabebe commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Problem:
mz_catalog.mz_default_privileges and mz_catalog.mz_system_privileges are
BuiltinTables. This requires coordinated writes from a single
environmentd process, conflicting with the multi-envd goal.

Solution:
Convert both to BuiltinMaterializedViews backed by queries over
mz_internal.mz_catalog_raw.

To express the acl_mode -> char-code mapping in SQL, this commit adds a
new scalar function mz_internal.parse_catalog_acl_mode(jsonb) -> text,
which mirrors AclMode::from_bits + Display.

The populator functions pack_default_privileges_update and
pack_system_privileges_update are deleted from builtin_table_updates,
and the corresponding StateUpdateKind arms in apply.rs short-circuit to
Vec::new().

Testing:
New behavioural SLTs for mz_default_privileges and mz_system_privileges

@mtabebe mtabebe force-pushed the ma/convert-builtins/mz-privileges branch from 166c74e to f220030 Compare June 15, 2026 18:26
…inMaterializedView

Problem:
mz_catalog.mz_default_privileges and mz_catalog.mz_system_privileges are
BuiltinTables. This requires coordinated writes from a single
environmentd process, conflicting with the multi-envd goal.

Solution:
Convert both to BuiltinMaterializedViews backed by queries over
mz_internal.mz_catalog_raw.

To express the acl_mode -> char-code mapping in SQL, this commit adds a
new scalar function mz_internal.parse_catalog_acl_mode(jsonb) -> text,
which mirrors AclMode::from_bits + Display.

The populator functions pack_default_privileges_update and
pack_system_privileges_update are deleted from builtin_table_updates,
and the corresponding StateUpdateKind arms in apply.rs short-circuit to
Vec::new().

Testing:
New behavioural SLTs for mz_default_privileges and mz_system_privileges
@mtabebe mtabebe force-pushed the ma/convert-builtins/mz-privileges branch from f220030 to 77767b0 Compare June 15, 2026 19:00
@mtabebe mtabebe marked this pull request as ready for review June 15, 2026 20:08
@mtabebe mtabebe requested review from a team as code owners June 15, 2026 20:08
@mtabebe

mtabebe commented Jun 15, 2026

Copy link
Copy Markdown
Contributor Author

The test failures are failures on main too in nightly (2 caused by me .. I'm working on a fix)

@mtabebe mtabebe requested a review from ggevay June 15, 2026 20:08
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.

1 participant